Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Popup Windows w/- Javascript - possible fix - maybe!?!

Status
Not open for further replies.

idaryl

Technical User
Nov 10, 2001
156
US
Popup Windows w/- Javascript - possible fix - maybe!?!

Hello everyone,

I've been using Dreamweaver to generate all of my html pages now for awhile ... and just recently many of my clients have been calling with the same problem -- "popup windows"

Quite a few of my clients have javascript pop windows for extra information, remote windows and just other assorted stuff, and for the most part, they have worked fine up until recently.

Now, (I guess because of unwanted ads) a percentage of people are now using "popup blockers" to stop those annoying ads. However, they also interfere with the pop windows actually built for the site.

I have here a sample of the window pop script I currently use; a very small amount of code: I hope this snippet may be of use to someone, somewhere as it appears to have solved this issue for me.

<!-- href popup
<a href="yourpage.htm" style="cursor:help" onClick="window.open(this.href, 'popupwindow', 'width=400,height=300,scrollbars,resizable'); return false;">Page Link Here</a>


OK so here's the rub! If someone has blocking turned on then some javascript popup windows don't work! This script will open a popup window, bypassing the "popup blockers"?!? (I have only tested this on major browsers - so I'm sure what others may find......

or... there so many blockers; its almost an impossible task - if so!..... does anyone have an idea of how to open these little windows without the hassle?

OH! I added the cursor style in case you may want to "dress" up the link on mouseover. Also you can rename the 'popwindow' to whatever, if you wish.
 
I use panicware popup stopper and your script popup was blocked successfully. Good luck in your search for a script that bypasses the blockers, but as soon as you find one the dev teams will be working on a way to stop you.

This is because there is no way to determine if a popup is a needed part of a site or just some advert for another dating agency.

You may wish to look into using show hide layers rather than popups.

Cheech

[Peace][Pipe]
 
As information Window XP SP2's pop-up blocker will block any pop-up script that was not initiated by the user. The example you provided is user initiated and SP2 will not block it, but something like:

Code:
<body onload="window.open(this.href, 'popupwindow', 'width=400,height=300,scrollbars,resizable'); return false;">

will be blocked.

Cheech is right though. The only way around popup blockers is to educate the user that they should allow popups from your site.

I should add that these particular tips only relate to the pop-up blocker for XP SP2.

Hope it helps.

Wow JT that almost looked like you knew what you were doing!
 
one way of dealing with it is simply noting that "this contains popup windows"
notice on yahoo.com when u get the search result u will see a little icon that indicates "opening of new window"
...
all the best!


:--------------------------------------------------------------------------:
fugitive.gif

ok,ok...I did shoot the deputy but he told me he was the sheriff!
:--------------------------------------------------------------------------:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top