Javascript / popup window

  • Thread starter Thread starter Brian Shannon
  • Start date Start date
B

Brian Shannon

I have a javascript function that is executed when a link button is clicked:

If Not (Page.IsClientScriptBlockRegistered("PopupWindow")) Then
Page.RegisterClientScriptBlock("PopupWindow", Script)
End if

Script is a variable that is filled from calling a function that filles in
all the assigned variables
for the new window to open.

My problem is that I can't keep the window on top. It opens on top but when
my .aspx page finishes refreshing then the .aspx pages opens on top of my
pop up window. How can I keep my pop window on top.

I am not very knowledgeable with javascript and luckily got this function to
work after a lot of help on the newsgroups.

Is there a modal window I should use? I currently use window.open("link",
variables)

The window list instructions if the user needs them for an intranet
application.

Thanks
 
use
ob=window.open(url)
ob.focus()

That will keep the popup on top.
Or you can use showModalDialog(url)
 
note that xp-sp2 which goes into wide release next week, will prevent this
code from running. i'd reengineer the page.


-- bruce (sqlwork.com)
 
Thanks for the tip. What exactly is the service pack going to prevent?
Javascript functions using windows.open?

Thanks
 
in the default setting, it prevents javascript from opening windows unless
its associated to a users click.

so,

<script>function doOpen() {window.open(url) } </script>
<input type="button" onclick="doOpen();" value="open window">

will open a windows while inline code like:

<script> window.open(url); </script>

will fail

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top