Open page in an already open frame - works in ie but not in Mozilla

Discussion in 'Javascript' started by geefypants, Oct 28, 2004.

  1. geefypants

    geefypants Guest

    Problem:
    ---------
    - When link is clicked need website with frames to be opened first
    - Next need to open second website in a frame defined in the first
    website (frameset.htm - frame is mainFrame)
    - Need to use javascript in order to make all of this happen in only a
    second window. If that window is minimized it needs to automatically
    be maximized or focussed to the front
    - All of this works on Internet explorer - does not work with Mozilla
    (which is what the product is on)
    - Code is below

    Questions
    ---------
    - Is there a different way to go about doing this in javascript?
    - Is there a setting in Mozilla about:config that is not allowing
    javascript to find the frame mainFrame?



    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <HTML>
    <HEAD>
    <TITLE> Testing </TITLE>

    </HEAD>

    <BODY>

    <script language="JavaScript" type="text/javascript">
    function OpenMainPage()
    {
    var NewWindow=open('','popup','menubar=0,toolbar=0,location=0,directories=1,scrollbars=1,resizable=1,status=1,width=1000,height=640');NewWindow.focus();window.open('frameset.htm',TARGET="popup");
    }
    function OpenPage4(page)
    {
    open(page,TARGET="mainFrame");
    }
    function delay(gap)
    {
    var then, now;
    then=new Date().getTime();
    now=then;
    while( (now-then)<gap)
    {
    now=new Date().getTime();
    }
    }

    function OpenPage8(page)
    {
    OpenMainPage();
    OpenPage4(page);
    }
    </script>

    <BR><A HREF="javascript:OpenMainPage()">1 Open Main Frame</A>
    <BR><A HREF="javascript:OpenPage4('http://www.yahoo.com')">4 Yahoo</A>
    <BR><A HREF="javascript:OpenPage8('http://www.hotbot.com')">8
    hotbot</A>



    </BODY>
    </HTML>
     
    geefypants, Oct 28, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Manuel
    Replies:
    3
    Views:
    750
    =?Utf-8?B?RXJpYyBXaWxzb24=?=
    Jan 5, 2006
  2. peshrad
    Replies:
    1
    Views:
    160
    Chris
    Jul 22, 2004
  3. Keegan Alex

    Code works in IE but not Netscape/Mozilla

    Keegan Alex, Jul 30, 2003, in forum: Javascript
    Replies:
    1
    Views:
    110
    Janwillem Borleffs
    Jul 30, 2003
  4. Patrick
    Replies:
    2
    Views:
    141
    Patrick
    Aug 26, 2003
  5. David Springthorpe

    Works OK In IE6 But Not In Mozilla Firefox 0.9.2

    David Springthorpe, Aug 22, 2004, in forum: Javascript
    Replies:
    1
    Views:
    87
    Michael Winter
    Aug 22, 2004
Loading...

Share This Page