homepage Welcome to WebmasterWorld Guest from 54.197.183.230
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Avoid popup blocking
kadnan

10+ Year Member



 
Msg#: 5050 posted 11:28 am on Feb 22, 2006 (gmt 0)

Hi

i have a page which i want to skip by popup blockers.I am using following code:

window.open('url.com','mywindow','width=400,height=200,toolbar=yes, location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,copyhist­ory=yes, resizable=yes');

its still blocking my page

any idea?

thanks

 

harry_wales

5+ Year Member



 
Msg#: 5050 posted 12:03 pm on Feb 22, 2006 (gmt 0)

What you are trying to do is actually an offence in some countries.

If I put a lock on my door you have no right to break through it. In the same way, if I put locks on my browser you have absolutely no right to break through it and would indeed start a war between us. I would certainly take the time out to report you in such a case...

zooloo

10+ Year Member



 
Msg#: 5050 posted 1:29 pm on Feb 22, 2006 (gmt 0)

Getting round my pop-up blocker isn't going to get me as a customer.

If anything I would avoid you.

Don_Hoagie

5+ Year Member



 
Msg#: 5050 posted 2:05 pm on Feb 22, 2006 (gmt 0)

The O.P. was unclear (and neither of you asked) whether he/she is intending to create an actual pop-up (an unprompted/unrequested window or other display item), or simply create a new page that happens to open in a smaller window, having the appearance of a pop-up.

While some poeple may not prefer browsing with the latter, it is certainly a justifiable and warranted technique... how many times have you been submitting a lengthy form online and had to click the "not sure what this means?" link next to a field... would you rather have that link send you to an entirely new page, or pop up with a small bit of info, letting you comfortably remain on your lengthy form page?

From what I can tell, this appears to be what you're trying to do. The question of how much of a "pop-up" it is depends on the behavior that prompts it... if it's *onmouseover*, many pop-up blockers will block it. But if it's *onclick* (at which point, it is a REQUESTED window by the user, and is really not a pop-up), it should open fine in most browsers and be recognized as a legit new window by pop-up blockers.

kadnan

10+ Year Member



 
Msg#: 5050 posted 5:14 pm on Feb 22, 2006 (gmt 0)

The popup is not a typical spamming popup,it is actually page shows a record details which is annoying if i show as a seprate page and let my user go back and forth for showing details and get back to list.

IE provides showModaldialog method to perform such task,someone siad by setting toolbar=yes,i can cheat toolbars but it doesn't happen quite often.

what i am thinking to provide a normal link and onLoad() of PopWindow,i set window width and height,is it possible?does window object support it?

Thanks

Don_Hoagie

5+ Year Member



 
Msg#: 5050 posted 7:09 pm on Feb 22, 2006 (gmt 0)

If you try to pop the window onload, you will in most cases get your pop-up blocked. As I mentioned, the behavior that triggers the new window is one of the primary red flags for pop-up blockers... if it's onmouseover, you will most likely have it blocked... if it's onload, you probably have an even worse chance of it getting through.

If it's an informative pop, meant to ease the flow of content to the user, you should create it as a new window and use a behavior that indicates that the user WANTED the window to open- i.e., onclick. You will usually get past pop-up blockers that way, not because you're cheating them, but because you've successfully convinced them that it's not a malicious pop-up.

kadnan

10+ Year Member



 
Msg#: 5050 posted 7:21 pm on Feb 23, 2006 (gmt 0)

you mean event simulation?

what i did was

<div id="mydiv" style=display:none onClick="javascript:openme()"></div>

then i simulated onCLick like that

<script>
document.getElementById("mydiv").onclick();
</script>

it is still blocking it.

i also tried using setTimeout() method by setting delay of 5/6 secs as somebody told that toolbar blocks window if they are popped up within 5 seconds.

Let me clarify that my App is intranet based and will run on IE only,i tried showmodalDialog() and showModalLessDialog(),not behaving properly,ShowModalLess() could solve problem but it always go behind the scene

JollyK

10+ Year Member



 
Msg#: 5050 posted 8:48 pm on Feb 23, 2006 (gmt 0)

I know this isn't really desirable, but you can put an awful lot of text into an "alert()" box. Yes, it's gray and ugly, but it does seem to get past a lot of popup blockers where window.open() and even "href target="_blank"" get blocked.

Although more software is also blocking alerts because of popup spammers trying to use them to get past blocking software. :-)

I think calling it from within a Flash element is still hard to block. And CSS visible/invisible type things can work as well -- maybe have a layer that floats way off to the side instead of a popup window?

As a side note, if it's an intranet application, can't you just make the people allow popups from just your site?

Okay, not the best suggestions, but all things I've seen other people try. :-)

JK

kadnan

10+ Year Member



 
Msg#: 5050 posted 5:18 am on Feb 24, 2006 (gmt 0)


lot of text into an "alert()" box. Yes, it's gray and ugly, but it does seem to get past a lot of popup blockers..

care to explain?i didn't understand this.


I think calling it from within a Flash element is still hard to block. And CSS visible/invisible type things can work as well -- maybe have a layer that floats way off to the side instead of a popup window?

Actually i have to openwindow on opening of browser.I am actually making application for new google toolbar 4 Beta which requires authentication,similar to toolbar bookmarking system pops up Login Window but toolbar itself is blocking window.open() method and showmodalDialog() method of IE doesn't work either since it doesn't loose focus.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved