windows safari and windows

Discussion in 'Javascript' started by Andrew Poulos, Jun 14, 2007.

  1. Testing locally on an Win XP box with the safari pop up blocker disabled:

    window.close();
    will close the window without warning even though the window was not
    opened by javascript.

    win = window.open("test.htm","foo");//, str);
    alert(win);
    does not open a new window and the value displayed by the alert is
    "undefined" (shouldn't it be "null" if there was a problem???). Also
    safari's activity window doesn't show any problems encountered.

    If I put a link on the page
    <a href="test.htm" target="_blank">click here</a>
    then when you click the link it does open a new window.

    How do I get windows safari to open new window with javascript from an
    onclick event?

    Andrew Poulos
     
    Andrew Poulos, Jun 14, 2007
    #1
    1. Advertising

  2. Andrew Poulos

    Randy Webb Guest

    Andrew Poulos said the following on 6/13/2007 7:18 PM:
    > Testing locally on an Win XP box with the safari pop up blocker disabled:
    >
    > window.close();
    > will close the window without warning even though the window was not
    > opened by javascript.
    >
    > win = window.open("test.htm","foo");//, str);
    > alert(win);
    > does not open a new window and the value displayed by the alert is
    > "undefined" (shouldn't it be "null" if there was a problem???). Also
    > safari's activity window doesn't show any problems encountered.
    >
    > If I put a link on the page
    > <a href="test.htm" target="_blank">click here</a>
    > then when you click the link it does open a new window.
    >
    > How do I get windows safari to open new window with javascript from an
    > onclick event?


    Submit a bug report and wait on it to get out of Beta.

    --
    Randy
    Chance Favors The Prepared Mind
    comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
    Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
     
    Randy Webb, Jun 14, 2007
    #2
    1. Advertising

  3. Andrew Poulos

    -Lost Guest

    Andrew Poulos wrote:
    > Testing locally on an Win XP box with the safari pop up blocker disabled:
    >
    > window.close();
    > will close the window without warning even though the window was not
    > opened by javascript.
    >
    > win = window.open("test.htm","foo");//, str);
    > alert(win);
    > does not open a new window and the value displayed by the alert is
    > "undefined" (shouldn't it be "null" if there was a problem???). Also
    > safari's activity window doesn't show any problems encountered.


    No, I expect undefined. null would be in the case of the variable not
    existing in Safari. undefined at least tells you that it sees the
    variable, the variable just has no value.

    > If I put a link on the page
    > <a href="test.htm" target="_blank">click here</a>
    > then when you click the link it does open a new window.
    >
    > How do I get windows safari to open new window with javascript from an
    > onclick event?


    I see your problem. I noticed the same thing, for example:

    <p onclick="window.open('safari.htm', 'safari_win',
    'width=200,height=200');">named</p>

    ....does not work, whereas:

    <p onclick="window.open('', 'safari_win',
    'width=200,height=200');">unnamed</p>

    ....works just fine. Of course this begs the question, how the hell can
    that be useful? I don't know.

    I do know that you can post to a new window successfully, but not open
    an existing document or URL. At least not in the fashion previously
    discussed.

    I think what Randy said is probably the most helpful at this point.

    --
    -Lost
    Remove the extra words to reply by e-mail. Don't e-mail me. I am
    kidding. No I am not.
     
    -Lost, Jun 14, 2007
    #3
    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. Stijn Goris
    Replies:
    2
    Views:
    1,050
    Jim Royal
    Feb 16, 2004
  2. Mark Rae

    Safari on Windows

    Mark Rae, Jun 11, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    347
    Evan M.
    Jun 12, 2007
  3. Bernhard Sturm

    Windows XP: Safari 3

    Bernhard Sturm, Jun 11, 2007, in forum: HTML
    Replies:
    17
    Views:
    766
    Animesh K
    Jun 13, 2007
  4. cwdjrxyz
    Replies:
    0
    Views:
    1,537
    cwdjrxyz
    Jun 16, 2007
  5. cwdjrxyz
    Replies:
    0
    Views:
    1,958
    cwdjrxyz
    Jun 20, 2007
Loading...

Share This Page