CodeOverload
CodeOverload

Reputation: 48495

How to detect when a frame url is changed?

I have the following:

<frame src="myframe.htm" id="myframe"/>
<frame src="http://www.google.com" id="external" />

How to detect any new url in the frame "external" when clicking a link on it so i can display it on the frame "myframe" ? I want to use javascript for that

Thanks

Upvotes: 1

Views: 416

Answers (1)

Pekka
Pekka

Reputation: 449555

How to detect any new url in the frame

If the iframe's document is not on the same domain as the parent page, the short answer is: You can't due to the Single Origin Policy.

However, if you control the page containing the links, you might be able to give links a target like <a target="external" href=..... which should open the links in the other iframe.

Upvotes: 1

Related Questions