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.