views:

21

answers:

1

I have a page in flex and on this webpage I have an iframe. I want to add code in javascript, that will detect when the page in the iframe changes (for example, if someone clicks on a link within the iframe) and I want to know what the URL of the new page in the iframe is.

Is there any way to do this?

+2  A: 

There is no way to do this if the pages in the iframe are on a different domain than the parent page due to the Single Origin Policy.

If they are on the same domain, and you know which pages are being called in the iframe, it would probably be easiest to give each page in the iframe an onload event that informs the parent page of the changed URL.

For code, you would have to give more detail on what the parent page is supposed to do with this information.

Pekka