views:

26

answers:

2

I'm trying to figure out the best and simplest way of opening HTML pop-up windows.

UPDATE: This is not intended to spam. By pop-up I mean a new window without the toolbars. I need it for something similar to the facebook connect API.

I'm currently using a js

<script type="text/javascript">
function popUp(URL) {
id = "hello";
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=628,height=326,left = 406,top = 287');");
}
</script>

and then adding it to the link

<a href="javascript:popUp('http://www.google.com')"&gt;Pop up</A>

it works fine but I'm not sure if the method has been depreciated.

A: 

According to this, it will most likely be blocked by a popup blocker, but it seems like that's been the way to go for some time.

http://eloquentjavascript.net/chapter11.html#key11

Carl
A: 

Pop-ups are annoying. However the best way to do it if you have to is to make it accessible to people who turn of Javascript:

<a href="http://google.com/" target="_blank" onClick="popUp('http://google.com/'); return false">
Cfreak