[KLUG Members] Javascript popup window?

Todd Pillars todd at terralabs.com
Thu Jul 28 10:23:02 EDT 2005


Bruce Smith wrote:
> Short story:  I need to create a bookmark in Firefox on Win-XP that
> launches a popup window.  So I created this URI a bookmark:
> 
> javascript:window.open("http://some.url/", "demo", "width=400, height=300");
> 
> However in XP, the popup window appears "under" the main window, making
> it hard to get to.  How can I raise this window to the top???  I tried
> calling focus() without any luck.
> 
> How can I make this a pop-up, not a pop-under?
I don't know if this helps but tried on WinXP it pops up on top

I use one of two

1. In the <head>

<head>
<script language="JavaScript">
<!--
function popUp(URL) {
     day = new Date();
     id = day.getTime();
     eval("page" + id + " = window.open(URL, '" + id + "', 
'toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=yes,width=200,height=100,left=100,top=50');");
}
//-->
</script>
</head>

In the <body>

<body>
<a href="javascript:popUp('whatever.html'); return false;">
</body>

2. for a one link shot

<body>
<a 
href="javascript:window.open('whatever.html','popup',''toolbar=0,scrollbars=yes,location=0,statusbar=0,menubar=0,resizable=yes,width=200,height=100,left=100,top= 
0'); return false;">
</body>

Hope this helps
Todd


More information about the Members mailing list