Forum Moderators: open
Clicking on a product brings the product details up in a pop-up (or main window if java is disabled). As it is not an online shop the client wants a link to their contacts page in the pop-up.
I can get the contacts page to load in the parent fine but can't get the pop-up to automatically close.
I found the script for it here from txbakers [webmasterworld.com...]
So in the pop-up header I've put:
<script>
function main() {
opener.location.href="../contact.htm";
window.close();
}
</script>
and in the body:
<a href="../contact.htm" onClick="main()">contact us</a>
This appears to be what txbakers has listed in the above link so where am I going wrong?
TIA
Beau
Will leaving it in / taking it out affect how the link works when a user who has javascript disabled accesses the page?
The previous page that loads the pop up is coded so that if a user has javascript disabled the popup page will load in the parent. Obviously what I don't want to happen in that case is to cause a conflict when that user then clicks on the link (as there is no window needing to be closed).