curly_brackets
curly_brackets

Reputation: 5598

When iFrame changes page

Is there any way you can fire a function when a iframe has changed its page (load function), without having to add anything to the iframe content?

Thank you in advance.

Upvotes: 0

Views: 170

Answers (1)

mahemoff
mahemoff

Reputation: 46379

I'm assuming the iframe contents are from another origin, in which case the answer is no. Browsers won't tell you the current URL of a child iframe unless its same-origin, so I don't think they'll fire an event when it changes.

Here's a demo which recognises when the first load event takes place, but doesn't log any subsequent page changes: http://jsfiddle.net/GPh6H/

Upvotes: 1

Related Questions