I'd like for the opener of an iframe to be able to detect each time the user changes pages within that iframe. Using jQuery, I can detect each time a page finishes loading within an iframe via the following:

$('#myIframe').on('load', function() {/*do stuff*/});

However, I'd also like to detect (in the iframe opener) each time a page starts loading within that iframe.

Note: The content that is displayed in the iframe is from a third-party site, so I don't have the ability to insert code there so that the iframe can explicitly alert the opener.

Does anyone know of an event that is fired when a page begins loading? I'm not having much luck finding anything via Internet searches, as most people seem to only be interested in detecting when the iframe has finished loading.

How are u loading the content on the iframe, is it through javascript when parent window gets loaded completely or just on the same http reponse of the parent window ?? Based on that I think I could answer your question??
–
prabeen giriMar 21 '13 at 22:05

doing this cross-domain? Not so easy. You’ll get something along the line of: Child document does not have the right to access parent document. In fact there is a lot of documentation on the web about how to achieve it, but the problem is that it is often outdated, with solutions that often only works in a couples of browsers.