Skip to content

Tag: iframe

Get current URL from IFRAME

Is there a simple way to get the current URL from an iframe? The viewer would going through multiple sites. I’m guessing I would be using something in javascript. Answer For security reasons, you can only get the url for as long as the contents of the iframe, and the referencing javascript, are served f…

How to prevent IFRAME from redirecting top-level window

Some websites have code to “break out” of IFRAME enclosures, meaning that if a page A is loaded as an IFRAME inside an parent page P some Javascript in A redirects the outer window to A. Typically this Javascript looks something like this: My question is: As the author of the parent page P and not…

Invoking JavaScript code in an iframe from the parent page

Basically, I have an iframe embedded in a page and the iframe has some JavaScript routines I need to invoke from the parent page. Now the opposite is quite simple as you only need to call parent.functionName(), but unfortunately, I need exactly the opposite of that. Please note that my problem is not changing…