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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

refresh pop up window

Status
Not open for further replies.

jezx

Technical User
Jul 15, 2002
18
0
0
GB
How do I refresh a window when using the script?

<a href=&quot;javascript:location='#.html';window.open('cottagesb001a.html','photo01','HEIGHT=385,WIDTH=450,')&quot;>

the window opens but if I go to main page and click another image to open in same window the window is at the back
 
Instead of href-ing to the new location, have it href=# and onClick=goTo(URL);

Code:
function goTo(URL)
{
 newWin = window.open(URL,'','HEIGHT=385,WIDTH=450,');
 newWin.focus();
}//end goTo(var, var)

I haven't tested it, but you might also be able to just alter your existing code (for every image!) as such:

Code:
<a href=&quot;javascript:location='#.html';var newWin=window.open('cottagesb001a.html','photo01','HEIGHT=385,WIDTH=450,');newWin.focus();&quot;>

...but, like I said, that would require updating EVERY image-anchor-link and the function is much cleaner.

'hope this helped.

--Dave
 
Thanks that worked great.
can use it on lots of sites I already made but don't have focus.
thanks again
jezx
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top