window.open does not work in mozilla

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

    window.open does not work in mozilla

    The following code used to popup a window when I used netscape 4.79.
    Now I switched to mozilla 1.4 and the window doesn't popup.

    function newWindow(newCo ntent)
    {
    winContent =window.open(ne wContent,'nextW in','screenX=0, screenY=20,widt h=600....);
    winContent.focu s();
    }

    ....
    <a href="javascrip t:newWindow('fo o.html')"
  • Hywel

    #2
    Re: window.open does not work in mozilla

    In article <c40f96d9.04061 11140.17c485cc@ posting.google. com>, kaith
    says...[color=blue]
    > The following code used to popup a window when I used netscape 4.79.
    > Now I switched to mozilla 1.4 and the window doesn't popup.
    >
    > function newWindow(newCo ntent)
    > {
    > winContent =window.open(ne wContent,'nextW in','screenX=0, screenY=20,widt h=600....);
    > winContent.focu s();
    > }[/color]

    Have you configured Mozilla to disallow pop-ups?

    --
    Hywel I do not eat quiche


    Comment

    • DU

      #3
      Re: window.open does not work in mozilla

      kaith wrote:
      [color=blue]
      > The following code used to popup a window when I used netscape 4.79.
      > Now I switched to mozilla 1.4[/color]

      Mozilla 1.7 will be out in a few days. Mozilla 1.4 is already 1 year old.

      and the window doesn't popup.[color=blue]
      >
      > function newWindow(newCo ntent)
      > {
      > winContent =window.open(ne wContent,'nextW in','screenX=0, screenY=20,widt h=600....);[/color]

      top and left are supported by NS 7.x, Mozilla 1.x, MSIE 5+, Opera 7.x
      while screenX and screenY are only supported by NS 4+ and Mozilla.
      [color=blue]
      > winContent.focu s();[/color]

      This winContent.focu s() call is unneeded and illogical. You should
      instead verify/test if the popup exists and is not closed and if so,
      then bring it back on top.
      [color=blue]
      > }
      >
      > ....
      > <a href="javascrip t:newWindow('fo o.html')"[/color]

      Make sure you have javascript support enabled.

      If you code that way, by resorting to the "javascript :" pseudo-protocol,
      Mozilla users won't be able to use Ctrl+click on the link to open in a
      tab nor use Ctrl+Enter or Middle-click to open in a new tab. They won't
      be able to open the link in other ways by choosing from their context
      menu since the browser no longer sees the href value as a valid href
      resource.
      Finally, using "javascript :" pseudo-protocol is bad for a last reason:
      nothing happens if javavscript support is disabled or non-existent:
      about 5%-10% of people on the web surf without javascript support enabled.



      Top Ten Web-Design Mistakes of 2002
      6. JavaScript in Links
      Every year brings new mistakes. In 2002, several of the worst mistakes in Web design related to poor email integration. The number one mistake, however, was lack of pricing information, followed by overly literal search engines.


      "
      Don't use javascript: URLs
      Using a straight http: URL will allow any browser to access the link. If
      you want to use JavaScript for browsers that have JavaScript enabled,
      use the onMouseOver and onClick attributes of the <a href> tag.
      "


      DU

      Comment

      • Thomas 'PointedEars' Lahn

        #4
        Re: window.open does not work in mozilla

        kaith wrote:[color=blue]
        > The following code used to popup a window when I used netscape 4.79.
        > Now I switched to mozilla 1.4 and the window doesn't popup.
        >
        > function newWindow(newCo ntent)
        > {
        > winContent =window.open(ne wContent,'nextW in','screenX=0, screenY=20,widt h=600....);
        > winContent.focu s();
        > }[/color]

        Unless you have disabled JavaScript popups in Mozilla 1.4, it would be
        helpful if you posted all window features you have specified with the
        third argument of window.open().
        [color=blue]
        > ...
        > <a href="javascrip t:newWindow('fo o.html')"[/color]

        <http://jibbering.com/faq/#FAQ4_24>


        PointedEars

        Comment

        Working...