Results 1 to 3 of 3

Thread: iframe issue

  1. #1
    Join Date
    Jan 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy iframe issue

    Hi,

    I have 2 iframes on a web page.

    In 1st iframe there is a BUTTON, On Button click new pages should open in both the iframes.

    I tried using window.parent , but it doesn't work in firefox, chrome, IE 8.

    Following is the code :-

    Main Page

    <body>
    <iframe src="1.htm" name="MapFrame"></iframe>
    <iframe src="1.htm" name="MapFrame1"></iframe>
    </body>
    </html>

    1st IFrame

    <html>
    <head>
    <title>1 Level</title>
    <script type="text/javascript">

    function GoToParent()
    {
    window.parent.document.getElementById("MapFrame"). src = "1.htm";
    window.parent.document.getElementById("MapFrame1") .src = "1.htm";
    }
    </script>
    </head>
    <body>
    <div id="page_effect" style="display:none;">
    <Button id="b1" type="button" value="CLICK ME" onClick="GoToParent()" />

    </div>
    </body>
    </html>


    Thank You....!!

  2. #2
    Join Date
    Jul 2008
    Posts
    128
    Thanks
    0
    Thanked 17 Times in 16 Posts

    Default

    Use the error console.

    In the real world, document.getElementById expects to be passed an ID.

  3. #3
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,859
    Thanks
    49
    Thanked 260 Times in 252 Posts
    Blog Entries
    56

    Default

    Try:
    function GoToParent()
    {
    top.frames["MapFrame"].location.replace("1.htm");
    top.frames["MapFrame1"].location.replace("1.htm");
    }

    ===
    Arie Molendijk.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •