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

Posts: 4
Location: China
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, 04:14 AM Re: about window.open in Safari
tripy's Avatar
Do not try this at home!

Posts: 2,818
Name: Thierry
Location: Latitude 46.79057 :: Longitude 7.119377
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 ?
__________________
Trust me, I know what's good for you...

tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 10-09-2007, 04:41 AM Re: about window.open in Safari
Junior Talker

Posts: 4
Location: China
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, 06:06 AM Re: about window.open in Safari
tripy's Avatar
Do not try this at home!

Posts: 2,818
Name: Thierry
Location: Latitude 46.79057 :: Longitude 7.119377
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.
__________________
Trust me, I know what's good for you...

tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 10-11-2007, 02:58 AM Re: about window.open in Safari
Junior Talker

Posts: 4
Location: China
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, 03:11 AM Re: about window.open in Safari
tripy's Avatar
Do not try this at home!

Posts: 2,818
Name: Thierry
Location: Latitude 46.79057 :: Longitude 7.119377
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.
__________________
Trust me, I know what's good for you...

tripy is offline
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Old 10-11-2007, 03:28 AM Re: about window.open in Safari
Junior Talker

Posts: 4
Location: China
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

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

vB 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.11210 seconds with 12 queries