window.open not working in IE5

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • venkatesh

    window.open not working in IE5

    Hi Members,

    I have used the below mentioned code to open a html page in a new
    browser. The window size is 200 x 300. In that browser, I've given
    code to open another browser of the same size. However, this is not
    happening in IE 5. Can anyone help me solve this problem?

    Code:

    Script:
    function newwindow1(newu rl)
    {
    popupWin=window .open(newurl,'o pen_window','me nubar=no,toolba r=no,location,d irectories,stat us,
    scrollbars,resi zable,dependent ,width=200,heig ht=300,left=0,t op=0')
    }

    Inside the HTML Body:

    <a href="#" onclick="javasc ript:newwindow( 'new.html');"
    class=lin>CLICK HERE a></P>

    with regards
    venkat.
  • DU

    #2
    Re: window.open not working in IE5

    venkatesh wrote:[color=blue]
    > Hi Members,
    >
    > I have used the below mentioned code to open a html page in a new
    > browser. The window size is 200 x 300. In that browser, I've given
    > code to open another browser of the same size. However, this is not
    > happening in IE 5. Can anyone help me solve this problem?
    >
    > Code:
    >
    > Script:
    > function newwindow1(newu rl)
    > {
    > popupWin=window .open(newurl,'o pen_window','me nubar=no,toolba r=no,location,d irectories,stat us,
    > scrollbars,resi zable,dependent ,width=200,heig ht=300,left=0,t op=0')[/color]

    1- dependent is only supported in NS 4+ and in Mozilla-based browsers
    2- you can make the windowFeatures string list more compact like this:

    popupWin=window .open(newurl, "open_windo w",
    "location,direc tories,status,s crollbars,resiz able,dependent, width=200,heigh t=300,left=0,to p=0");
    Once a single window feature has been defined, all others which are not
    defined are turn off.
    [color=blue]
    > }
    >
    > Inside the HTML Body:
    >
    > <a href="#" onclick="javasc ript:newwindow( 'new.html');"
    > class=lin>CLICK HERE a></P>[/color]

    Not good.
    1- If javascript is disabled or not supported, the requested popup
    window will not be opened when it should. 8% to 12% of users surf with
    javascript support disabled or with a browser without javascript.
    2- The popup might open but then the default action of the link is not
    cancelled: the opener is scrolled all the way back to the top after the
    opening of the window.
    3- The "javascript :" part in the onclick event handler is pointless,
    unneeded. You may declare in the <head> section
    <meta http-equiv="Content-Script-Type" content="text/javascript">
    to declare the default scripting language in your document:

    4- the class attribute value should be quoted
    5- Absolutely avoid "Click here" link labels. Use a descriptive label:

    Don't use "click here" as link text:

    6- newwindow is called but only newwindow1 is declared and defined. That
    was probably why you thought window.open was not working.

    So:
    <p><a href="new.html" target="open_wi ndow"
    onclick="newwin dow1(this.href) ; return false;" title="Clicking this link
    will open another window (popup)">See my garden <img
    src="http://www10.brinkster .com/doctorunclear/BrowserBugsSect ion/Opera7Bugs/Opera7BugDispla yInline.html"
    style="width:25 px; height:25px; border:0px none;" alt="alt="Click ing the
    link will create a new window (popup)"></a></p>

    The code could be further improved to make the requested popup recycling
    referenced, targeted resources. Only 1 popup opened at a time for
    possibly several links.
    Also, the code could be improved so that if the popup loses focus, it
    can be brought back by clicking the opener's link. Right now, as coded,
    the newwindow1 function does not do that... and this is known to be a
    very frequent usability problem, confusion factor for users.

    Open a link in a new window: when and how can that setting affect my
    surfing?


    Examples of use of recycling resources with/for a single popup:





    DU
    --
    Javascript and Browser bugs:

    - Resources, help and tips for Netscape 7.x users and Composer
    - Interactive demos on Popup windows, music (audio/midi) in Netscape 7.x


    Comment

    • Stuart Palmer

      #3
      Re: window.open not working in IE5

      Your function being called has a different name to the function (newwindow1
      and newwindow), remove the 1 in the funciton name. I have ie 5.5 and it
      works for me.

      Hope that helps

      Stu

      "venkatesh" <venkat2k_vb@ya hoo.co.in> wrote in message
      news:b259f1ac.0 310272334.23085 5a9@posting.goo gle.com...[color=blue]
      > Hi Members,
      >
      > I have used the below mentioned code to open a html page in a new
      > browser. The window size is 200 x 300. In that browser, I've given
      > code to open another browser of the same size. However, this is not
      > happening in IE 5. Can anyone help me solve this problem?
      >
      > Code:
      >
      > Script:
      > function newwindow1(newu rl)
      > {
      >[/color]
      popupWin=window .open(newurl,'o pen_window','me nubar=no,toolba r=no,location,d i
      rectories,statu s,[color=blue]
      > scrollbars,resi zable,dependent ,width=200,heig ht=300,left=0,t op=0')
      > }
      >
      > Inside the HTML Body:
      >
      > <a href="#" onclick="javasc ript:newwindow( 'new.html');"
      > class=lin>CLICK HERE a></P>
      >
      > with regards
      > venkat.[/color]


      Comment

      Working...