popups don't work with IE6

Discussion in 'Javascript' started by danielmcbrearty@gmail.com, Jan 16, 2006.

  1. Guest

    Hi

    Can anyone tell me why the following javascript code doesn't work with
    IE6? (It's fine with Firefox of course ...)

    (in teh document head)
    <script type="text/javascript" language="javascript1.2">
    <!--
    function smallpopup(purl)
    {
    var newwindow=window.open(purl,'engoi.com',
    'left=500,top=100,width=550,height=350,scrollbars=1,toolbar=1');
    if (window.focus) {newwindow.focus();}
    return false;
    }
    function largepopup(purl)
    {
    var newwindow=window.open(purl,'engoi.com',
    'left=500,top=100,width=550,height=500,scrollbars=1,toolbar=1');
    if (window.focus) {newwindow.focus();}
    return false;
    }
    -->
    </script>

    ..
    ..
    ..

    (in the document body)

    <a href="../somedir/myscript.cgi?lang=en"
    onClick="return smallpopup('../somedir/myscript.cgi?lang=en')">do it!
    </a>

    The doc loads with no errors, but when the link is clicked, IE6
    complains that the arg to the function is improper, and loads in a
    normal window.

    If anyone can help, that's great!

    Thanks

    Daniel
     
    , Jan 16, 2006
    #1
    1. Advertising

  2. Lee Guest

    said:
    >
    >Hi
    >
    >Can anyone tell me why the following javascript code doesn't work with
    >IE6? (It's fine with Firefox of course ...)
    >
    >(in teh document head)
    ><script type="text/javascript" language="javascript1.2">
    ><!--
    >function smallpopup(purl)
    >{
    > var newwindow=window.open(purl,'engoi.com',


    >The doc loads with no errors, but when the link is clicked, IE6
    >complains that the arg to the function is improper, and loads in a
    >normal window.


    No periods in window names.
     
    Lee, Jan 16, 2006
    #2
    1. Advertising

  3. VK Guest

    wrote:
    > Hi
    >
    > Can anyone tell me why the following javascript code doesn't work with
    > IE6? (It's fine with Firefox of course ...)
    >
    > (in teh document head)
    > <script type="text/javascript" language="javascript1.2">
    > <!--
    > function smallpopup(purl)
    > {
    > var newwindow=window.open(purl,'engoi.com',
    > 'left=500,top=100,width=550,height=350,scrollbars=1,toolbar=1');
    > if (window.focus) {newwindow.focus();}
    > return false;
    > }
    > function largepopup(purl)
    > {
    > var newwindow=window.open(purl,'engoi.com',
    > 'left=500,top=100,width=550,height=500,scrollbars=1,toolbar=1');
    > if (window.focus) {newwindow.focus();}
    > return false;
    > }
    > -->
    > </script>


    I don't believe you it works in Firefox... But off topic, anyway.

    1) Assigned window name is the 2nd argument of window.open(), not the
    1st one.
    2) Probably a string jam grace to Google Groups but just in case: the
    entire method call must be one line.

    This call works: (if it's broken on two or more lines it's because of
    your news reader: it is *one* line)

    var
    newwindow=window.open('http://www.google.com','www','left=500,top=100,width=550,height=350,scrollbars=1,toolbar=1');
     
    VK, Jan 16, 2006
    #3
  4. Randy Webb Guest

    VK said the following on 1/16/2006 4:15 PM:
    > wrote:
    >
    >>Hi
    >>
    >>Can anyone tell me why the following javascript code doesn't work with
    >>IE6? (It's fine with Firefox of course ...)
    >>
    >>(in teh document head)
    >><script type="text/javascript" language="javascript1.2">
    >><!--
    >>function smallpopup(purl)
    >>{
    >> var newwindow=window.open(purl,'engoi.com',
    >> 'left=500,top=100,width=550,height=350,scrollbars=1,toolbar=1');
    >> if (window.focus) {newwindow.focus();}
    >> return false;
    >>}
    >>function largepopup(purl)
    >>{
    >> var newwindow=window.open(purl,'engoi.com',
    >> 'left=500,top=100,width=550,height=500,scrollbars=1,toolbar=1');
    >> if (window.focus) {newwindow.focus();}
    >> return false;
    >>}
    >>-->
    >></script>

    >
    >
    > I don't believe you it works in Firefox... But off topic, anyway.


    It would as this question/problem was brought up a week or so ago.

    > 1) Assigned window name is the 2nd argument of window.open(), not the
    > 1st one.


    And nothing to the contrary in the code. The problem is the period in
    the window name. Firefox happily accepts it but IE doesn't.

    > 2) Probably a string jam grace to Google Groups but just in case: the
    > entire method call must be one line.
    >
    > This call works: (if it's broken on two or more lines it's because of
    > your news reader: it is *one* line)
    >
    > var
    > newwindow=window.open('http://www.google.com','www','left=500,top=100,width=550,height=350,scrollbars=1,toolbar=1');


    Because your window name does not have a period in it. Change your
    window name from 'www' to 'w.w.w' and your code will break in IE but
    work fine in Firefox.


    --
    Randy
    comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
    Answer:It destroys the order of the conversation
    Question: Why?
    Answer: Top-Posting.
    Question: Whats the most annoying thing on Usenet?

    Please quote what you are replying to.

    If you want to post a followup via groups.google.com, don't use the
    "Reply" link at the bottom of the article. Click on "show options" at
    the top of the article, then click on the "Reply" at the bottom of the
    article headers.
     
    Randy Webb, Jan 16, 2006
    #4
  5. VK wrote:
    > wrote:

    <snip>
    >> var newwindow=window.open(purl,'engoi.com',
    >> 'left=500,top=100,width=550,height=350,scrollbars=1,toolbar=1');

    <snip>

    > 1) Assigned window name is the 2nd argument of window.open(),
    > not the 1st one.


    Too drunk to even count?

    > 2) Probably a string jam grace to Google Groups but just in
    > case: the entire method call must be one line.

    <snip>

    What is the point in posting such an obvious lie? Surly it can only
    serve to make it obvious that you are a fool of staggering proportion (a
    redundant action given your posting record)?

    Richard.
     
    Richard Cornford, Jan 16, 2006
    #5
  6. Guest

    Thanks very much for the helpful replies ... the rest I'll ignore!
    D
     
    , Jan 17, 2006
    #6
    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. Ivor O'Connor
    Replies:
    4
    Views:
    875
    Isofarro
    Nov 25, 2003
  2. Moe Sisko
    Replies:
    1
    Views:
    868
    George
    Aug 4, 2008
  3. chrisp

    Help with IE6 popups needed

    chrisp, Sep 29, 2008, in forum: ASP .Net
    Replies:
    0
    Views:
    301
    chrisp
    Sep 29, 2008
  4. Replies:
    0
    Views:
    187
  5. Replies:
    0
    Views:
    108
Loading...

Share This Page