View Full Version : Close "popup" open link in previous window?
404notfound
06-26-2006, 10:42 AM
http://i16.photobucket.com/albums/b11/NickDCWesley/HTML/popup.gif
The image basicly explains what i am going for.
To have a link in the popup window close the popup and open the link in the prevous window that the popup came from.:eek:
Perhaps this thread would best be answered in the Javascript forum?
404notfound
06-26-2006, 10:59 AM
OK... I reposted it on Tek-tips.com
http://www.tek-tips.com/viewthread.cfm?qid=1247158&page=1
Thanks for the help.
_Aerospace_Eng_
06-26-2006, 12:53 PM
<script type="text/javascript">
window.onmousedown = function()
{
if(opener)
{
opener.location = 'page2.html';
window.close();
}
}
</script>
That would go in the popup page in between the head tags. The script will only work only if the page was opened as a popup. If you don't check for opener and try calling it, you will get an error.
vBulletin® v3.6.7, Copyright ©2000-2010, Jelsoft Enterprises Ltd.