Forum Moderators: open
On a certain page I wanted to make a link which opens a Popup window. So I put a Javascript in the code. But I see the WinXP popup-blocker blocks it (because it's a script I guess?).
here's the code I'm using:
- the script:
<SCRIPT LANGUAGE="JavaScript">
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=800,height=600,left = 240,top = 212');");
}
</script>
- the link:
<A HREF="javascript:popUp('projecten.htm')">Popup window</A>
So I was wondering if there is a way to make a Popup window in HTML only? (I was planning to use '_blank', but then you still have the menu's and toolbars? And I'd like to get rid of those too).
I really hope someone can help me with this.
* I hope that I've posted this in the right section, if not: my excuses
I've tested your code and it works fine. I tested it in Firefox with popup blocking on and still no problem. So I wonder if your popup blocking level is set too high? Rather than block unwanted popups (ie ones not requested by clicking) it blocks ALL popups?
The only way to open a window with no toolbars etc. is to use JavaScript. Using _blank will give you all of these.
HTH
is what I'm asking not possible
You might consider though just asking your visitors to unblock popups. With modern browsers it should be no problem to unblock them for just your site.
You also might reconsider, if you need a popup at all (as you don't specify your intentions I cannot say).
I'm suspencting only offline, XP will do this to any offline script, it's rather annoying. When uploaded to a server it will not.
You're correct, target=_blank" or target="new window" are the only two html methods and both have no control over toolbars.
Last, do this:
<A HREF="projecten.htm" onClick="popUp('projecten.htm'); return false;">Popup window</A>
instead of this:
<A HREF="javascript:popUp('projecten.htm')">Popup window</A>
"return false" only executes if Javascript is enabled, and tells the browser not to go to the URL in HREF. But if Javascript is malfunctioning or disabled, it won't execute the onClick and will go to the URL instead. So visitors can get to your page whether they have J.S. enabled or not.
Anytime you create a web site, ask yourself if this is something you like to see if you were surfing it. If it annoys you, then maybe it's better not to use it at all no matter how flashy it may be.
Annoyed customers just doesn't pay you.