Reply
about window.open in Safari
Old 10-09-2007, 04:50 AM about window.open in Safari
Junior Talker

Posts: 4
Location: China
Trades: 0
I have met a strange problem on Safari 3.0:
When I use window.open function in my Javascript functions, it can open new window in some certain functions, while cannot open new window in other functions.
And then all can work on Firefox.
I don't know why this happen, thanks for all your assistance in advance.
nadiadss is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 10-09-2007, 05:14 AM Re: about window.open in Safari
tripy's Avatar
Do not try this at home!

Posts: 3,139
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Could this be a popup blocker effect ?

Often, window.open calls are executed when they result of a direct action from a user.
For example:

The user click on a button which calls a function with the window.open => popup opens
The user click on a button which calls a function which calls another function with window.open => no popup
The page load and a window.open is called => no popup

Could this be something like that ?
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is online now
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 10-09-2007, 05:41 AM Re: about window.open in Safari
Junior Talker

Posts: 4
Location: China
Trades: 0
I think my problem is not a popup blocker effect. My code is like this:
function a(){
...
window.open("about:blank","","width=600");
b(param a, param b);
}
function b(param a, param b){
...
window.open("about:blank","","width=600");
}
the result is new window can open in function a, but cannot open in function b

Quote:
Originally Posted by tripy View Post
Could this be a popup blocker effect ?

Often, window.open calls are executed when they result of a direct action from a user.
For example:

The user click on a button which calls a function with the window.open => popup opens
The user click on a button which calls a function which calls another function with window.open => no popup
The page load and a window.open is called => no popup

Could this be something like that ?
nadiadss is offline
Reply With Quote
View Public Profile
 
Old 10-09-2007, 07:06 AM Re: about window.open in Safari
tripy's Avatar
Do not try this at home!

Posts: 3,139
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Yes it is! It's exactly what I explained you on my 1st post.

The function a() is the result of a direct user action, thus the window.open is allowed.
As b() is called FROM a(), it's not a direct action thus the browser refuse to open the popup.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is online now
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 10-11-2007, 03:58 AM Re: about window.open in Safari
Junior Talker

Posts: 4
Location: China
Trades: 0
Oh! I got it! I misunderstand you the last time. Thank you very much, tripy

But another question is, you say the browser will refuse to open the popup which is not a direct action, then why Firefox and IE allow this kind of popup?
nadiadss is offline
Reply With Quote
View Public Profile
 
Old 10-11-2007, 04:11 AM Re: about window.open in Safari
tripy's Avatar
Do not try this at home!

Posts: 3,139
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
Every browsers act differently in this field.
IE is the most tolerant, in my view.
FireFox allows it to be fine tune via the about:config, but if it allows the popup, it's probably because the popup are allowed.
It should behave the same way than safari.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is online now
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 10-11-2007, 04:28 AM Re: about window.open in Safari
Junior Talker

Posts: 4
Location: China
Trades: 0
You are so prompt^_^ Thanks again!
nadiadss is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to about window.open in Safari
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.13983 seconds with 13 queries