Closed Thread Icon

Topic awaiting preservation: pop up question (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=22913" title="Pages that link to Topic awaiting preservation: pop up question (Page 1 of 1)" rel="nofollow" >Topic awaiting preservation: pop up question <span class="small">(Page 1 of 1)</span>\

 
mas
Maniac (V) Mad Librarian

From: the space between us
Insane since: Sep 2002

posted posted 08-12-2004 19:03

hi guys
i have a pop up function(evil, i know) that opens up a window(with a desired page in it) if you call the function. however, what i want is that if i call the function again, then there shouldnt be another pop up, it should get loaded in the same window. could anyone help me with that? this would be great
here is the code:

code:
<script language="javascript">
<!-- Idea by: Nic Wolfe (Nic@TimelapseProductions.com) -->
<!-- Web URL: http://fineline.xs.mw -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=660,height=550,left = 310,top = 237');");
}
// End -->
</script>




B | T | E | P | L

Tyberius Prime
Paranoid (IV) Mad Scientist with Finglongers

From: Germany
Insane since: Sep 2001

posted posted 08-12-2004 19:53

German: http://de.selfhtml.org/javascript/objekte/window.htm#open

Quick for everyone: You need to pass in a name a the second parameter to that
function call. Then it should work...

kuckus
Paranoid (IV) Mad Librarian

From: Berlin (almost)
Insane since: Dec 2001

posted posted 08-12-2004 20:18

So as you want the second parameter to stay constant and not change every time the function is called (which happens through the id = day.getTime(); line in your current script) you can leave most of it out and also get rid of the evil eval along the way:

code:
function popUp(URL) {
page = window.open(URL, 'page', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=660,height=550,left = 310,top = 237');
}

mas
Maniac (V) Mad Librarian

From: the space between us
Insane since: Sep 2002

posted posted 08-12-2004 21:16

big thanks! i really appreciate your help

kuckus
Paranoid (IV) Mad Librarian

From: Berlin (almost)
Insane since: Dec 2001

posted posted 08-12-2004 21:30

any time =)

« BackwardsOnwards »

Show Forum Drop Down Menu