Jump to content

Pop-Up Windows Reused


TRI0N

Recommended Posts

I'm currently using this code to open up a window and what to know how I can make it so that if I click a link that it uses that window again rather then open up a new one.

 

<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
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=0,width=520,height=400');");
}
// End -->
</script>

 

Thanks for any help on this.

Link to comment
Share on other sites

Okay that was easy..  Pfft..  God can't even believe I didn't even see the dumb id code being built for it.  It would never be the same ID..

 

Anyways on to a more problematic need for a fix.

 

Now lets say the window is open and I click another link that uses that window to Focus on it since it is either minimized or not in view.

 

Current Code:

<!-- Begin
function popUp(URL) {
window.open(URL,"Window1", 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=520,height=400');
}
// End -->

 

Update:

 

A simple:

<body onload="self.focus();">

 

For the pages that are to load in the window does the trick.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.