Forum Moderators: open

Message Too Old, No Replies

Pop-up that doesn't get blocked

some help please?

         

fa565441

1:02 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



I'm building a website, it's still in progress, but I have a small problem.
I've searched the forum but I haven't found a topic which answers my question...

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

fa565441

1:54 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



is what I'm asking not possible
or is it not okey to request code?

BlobFisk

2:21 pm on Jun 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi fa565441 and welcome to WebmasterWorld!

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

johnl

2:29 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



Hi,

is what I'm asking not possible

It is possible, if you are prepared to invest a certain amount of work.

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).

fa565441

2:32 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



Thanks for the replies.

If it's the only possible way then I'll have to reconsider how necessairy the popup is.

rocknbil

4:43 pm on Jun 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



fa, tell us this: have you tried your new window both online and offline?

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.

newseed

6:40 pm on Jun 23, 2005 (gmt 0)

10+ Year Member



Personally, I hate any kind of pop-ups. If a sellar/owner cannot get it's point across within the content of the web page, then I have no desires to do business with them.

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.

rocknbil

8:18 pm on Jun 23, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You're missing the function, although he/she has labeled it popup, it's not an advertisement. It's a user-prompted new window, the content of which often has no place on the page and is only valuable as a small temporary window.

fa565441

12:22 pm on Jun 24, 2005 (gmt 0)

10+ Year Member



Indeed, this popup only opens when the user clicks the link. Thanks for the replies, I'll keep it in mind. I've put the Return thing in it too, thanks for the advise.

Much appreciated.