windows safari and windows

A

Andrew Poulos

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
 
R

Randy Webb

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.
 
L

-Lost

Andrew said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,969
Messages
2,570,161
Members
46,709
Latest member
AustinMudi

Latest Threads

Top