locked
IE9 document.location does not work inside frame RRS feed

  • Question

  • 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

    Tuesday, March 13, 2012 11:43 AM

Answers

  • 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^_^

    Tuesday, March 13, 2012 7:12 PM