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 开发者_JS百科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
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.
精彩评论