Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pop Open Window Problems 1

Status
Not open for further replies.

tyleri

Programmer
Jan 2, 2001
173
0
0
US
Hi - I posted a message yesterday attempting to make a pop-up window work. Well, I figured it out and everything works fine now - the window pops up, plays, and closes. THe only problem is - if I click the link again, nothing happens. If I hit refresh, I can click the link and the pop-up window works again, but I can't hit it more than once in the same viewing time.

Here is the code I wrote to get this to work right, and hopefully you know how to edit this so that I can click it again without refreshing and it will work.

<script language=Javascript>
<!--
function newPop(){
newPop = window.open('flash/acctsel.swf','newWin','width=550,height=405')
}
-->
</script>

...and in the body of the html code...

<a href=&quot;javascript:newPop()&quot;>CLICK HERE </a>

any ideas or suggestions to get this to refresh or work twice?
 
I don't think you need newPop =
That is how vbscript returns values from functions, not javascript
try

function newPop(){
window.open('flash/acctsel.swf','newWin','width=550,height=405')
}

if that is not it try
<a href=&quot;javascript:;&quot; onClick=&quot;newPop();&quot;>Click here</a>

also are you sure the pop up window closed?
if it is behind your main window the link will continue to open the file in the same window, but not bring it to the front.
 
hie
yeah, 2 open in a new window again & again use
window.open('flash/acctsel.swf','','width=550,height=405')
regards, vic
 
just a note tho : &quot;I don't think you need newPop =
That is how vbscript returns values from functions, not javascript&quot;
--> javascript DOES return values as well. You don't NEED it if you don't want to work with this window again. Now, suppose you want to close this window, or write anything in it, you'll need a way to reach it ... that is how it is done :
newPop = window.open(...)
newPop.write(&quot;hi&quot;)
newPop.close()

 
THanks guys! You all helped w/ the problem! It's solved
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top