Jump to content

JS Help


AV1611

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.