473,320 Members | 1,859 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

windows safari and windows

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
Jun 13 '07 #1
2 4731
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/
Jun 13 '07 #2
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.
Jun 14 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Paul W | last post by:
Hi - can someone point me to info on the issues/resolutions of supporting the safari browser? To help me understand, if I was developing pages in say FrontPage, what attributes would I set for...
34
by: Simon Wigzell | last post by:
document...focus() will scroll the form to move the specified text field into view on everything I have tried it with except Safari on the MAC. The form doesn't move. Any work around? Thanks.
21
by: Edward | last post by:
Hi All, I feel frustrated with one of my Customers who wants me to ensure that a dotnet web site I am building for them must be compatible to Apple's Safari browser! Safari is buggy and it...
3
by: Mark Rae | last post by:
http://www.apple.com/downloads Beta 3 - seems to work OK on XP - haven't tried on Vista yet... -- http://www.markrae.net
3
by: Amir Michail | last post by:
Hi, I have bookmarklets with a # in their urls but safari changes the # to %23. And unfortunately, the bookmarklet does not work with %23. You need to change it back manually to #. Any...
2
by: Jeff | last post by:
Okay, I read that Safari is now available for Windows, so I downloaded it to test on a vb.net/visual web developer 2005 app. that I created. The app works fine in other browsers. While in...
35
by: nobody | last post by:
I need to pop up a modal JS-based dialog (for some reason can't use popup window, much less so showModalDialog()), and I'd like to imitate the system popup titlebar according to user's desktop...
2
by: rudiedirkx | last post by:
Gents, I have a problem (only in Safari) with the onsubmit in webforms. This topic covers the same subject: http://bytes.com/topic/javascript/answers/166542-onsubmit-safari but not as detailed as...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.