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 SkipVought 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
0
0
US
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 believe that most popup blockers do not suppress windows when they are called by a direct user action (such as clicking a link). You could eliminate the javascript altogether and just add [tt]target="_blank"[/tt] but that removes the nice formatting.

--Chessbot

There is a level of Hell reserved for probability theorists in which every monkey that types on a typewriter produces a Shakespearean sonnet.
 
Hi Chessbot,

True - the target being a new window is fine but I guess in that case then a <BODY onload="window.resizeTo(555,350)"> feature will force the new window to a smaller size to accomodate the "design" however, the issue of the taskbar, resize, scrollbars, etc, etc is still apparent.

Thats why I'm trying to find a solution to this..

btw. I'm still struggling with that combo box thingy

idaryl
idface.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top