Ask coding questions

← Back to all posts
Need help with html and javascript.
MikeJMS8910 (159)

So currently I am making this thing with iframe so that you can go to a site but with a different URL. But I am having trouble with something. Every time the page changes from a site it could be on I need it so that it will tell me that the URL of the iframe is displaying has changed. So how can I do this? To see if an iframe has changed. I tried to use src but that doesn't update when the frame is changed.

xfinnbar (81)

"For security reasons, you can only get the url for as long as the contents of the iframe, and the referencing javascript, are served from the same domain. As long as that is true, something like this will work:


If the two domains are mismatched, you'll run into cross site reference scripting security restrictions." - kkyy on StackOverflow: