AV1611 Posted July 26, 2009 Share Posted July 26, 2009 I DO NOT know JS but I do know PHP That being said... I have the script in the head of a page: <SCRIPT TYPE="text/javascript"> <!-- function popup(mylink, windowname) { if (! window.focus)return true; var href; if (typeof(mylink) == 'string') href=mylink; else href=mylink.href; window.open(href, windowname, 'width=400,height=200,scrollbars=yes'); return false; } //--> </SCRIPT> I have this in the body: <BODY onLoad="popup('autopopup.html', 'ad')"> It works fine except I need to change it so if the main page (index.html) is reloaded, the popup is not reloaded, but rather it doesn't nothing. My PHP Solution would be to set a session in the popup and have a clause on the <body> tag to enable/disable the popup on reload, but it seems there should be a slick JS way to do it. Suggestions? Link to comment https://forums.phpfreaks.com/topic/167466-js-help/ Share on other sites More sharing options...
GingerRobot Posted July 26, 2009 Share Posted July 26, 2009 My PHP Solution would be to set a session in the popup and have a clause on the <body> tag to enable/disable the popup on reload, but it seems there should be a slick JS way to do it. I'd go with your PHP solution. Link to comment https://forums.phpfreaks.com/topic/167466-js-help/#findComment-883173 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.