IE9 document.location does not work inside frame
-
2012年3月13日 上午 11:43
Hi,
I have some issue with navigation inside frame in IE9. it does not happen in previous versions of IE.
I have one page contains frameset(test_farmes.html see the code below). the source of one frame from frameset is test.html (see the code below).
When I run test_farmes.html , I see button. when I click on this button, I should see google.com page, but when I using
document.location = http://google.com;
code nothing happens(only in IE9).
The question is: if something changed in IE9 that prevent navigation inside frame using document.location. If someone has already encountered this strange behaviour, please advice.
Please find the code of the files described below:
test.html
<html>
<head>
</head>
<body>
<script type="text/javascript"> function _onClick()
{
document.location = "http://google.com";
}
</script>
</body>
<button name="btn" onclick='_onClick();'>first click</button>
</html>
test_farmes.html
<html>
<head>
</head>
<frameset rows="100%" frameborder="0" framespacing="0" id="myframeset"> <frame name="main_frame" src="C:\Users\Administrator\Desktop\test.html" marginwidth="0" marginheight="0" scrolling="yes" frameborder="0" noresize>
</frameset>
</html>
Thanks,
Polina
所有回覆
-
2012年3月13日 下午 07:12
Google do not allow their content to be hijacked. they have scripts to check if window==_top. Probably you have different security zone settings in your Ie versions or you are encountering new security features for XXS....
Please add a valid document type declaration to your pages and validate the markup before posting it to this forum.
For help with writing web sites please start at w3schools.com
Rob^_^
- 已提議為解答 doctoroftypeMVP 2012年3月13日 下午 07:13
- 已標示為解答 Allen Li - MSFTModerator 2012年3月19日 上午 01:47

