Window.open() Doesn't work in IE 6&7

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ziycon
    Contributor
    • Sep 2008
    • 384

    Window.open() Doesn't work in IE 6&7

    I have the below code and it works fine in FF but in IE 6&7 it wont work, gives an error to do with window.open??
    Code:
    <script type="text/javascript">
                <!--
                function radio(dirLevel) {
                    window.open(dirLevel+"radio.html", "Radio", "status=1, height=120, width=450, resizable=0, top=20, left=20")
                }
                //-->
              </script>
  • Frinavale
    Recognized Expert Expert
    • Oct 2006
    • 9749

    #2
    The window.open method accepts the following parameters:

    window.open(URL ,name,specs,rep lace)
    Where:
    • URL: Specifies the URL of the page to open
    • name: Specifies the target attribute or the name of the window
    • specs: Is an optional, comma-separated list of items that specify how the child window should be displayed.


    It looks as if you are calling the method properly and that you are providing the correct values as parameters to the method....so long as the URL you are providing is valid.

    Check that your dirLevel contains a valid URL.

    Comment

    • acoder
      Recognized Expert MVP
      • Nov 2006
      • 16032

      #3
      What's the error message?

      Comment

      • prabirchoudhury
        New Member
        • May 2009
        • 162

        #4
        Window.open() Doesn't work in IE 6&amp;7

        1. check the error frm firefox "error console"
        2. you are looks like missing ";" semicolon after end of window.open line


        window.open(dir Level+"radio.ht ml", "Radio", "status=1, height=120, width=450, resizable=0, top=20, left=20")
        3. add a alert (dirLevel); inside the function to check that you are passing right directory link
        4. if still the problem then add return false after window.open line
        return false;

        Comment

        • ziycon
          Contributor
          • Sep 2008
          • 384

          #5
          Found out what it was, you wouldn't have gotten it as i just realised i posted the wrong code, it was being cause by a space in the name attribute, i replaced the space with and underscore and now its working fine.

          Comment

          • prabirchoudhury
            New Member
            • May 2009
            • 162

            #6
            thats nice .. enjoy coding..

            Comment

            Working...