Jump to content

[SOLVED] Detecting if JavaScript pop-up is blocked


rtadams89

Recommended Posts

I have the following javascript in the HEAD section of one of my pages

<script language="JavaScript">
function emailWindow() {
	eval(
	"page = window.open('email.php?id=<?php echo $id; ?>', '<?php rand(); ?>', 'toolbar=0,scrollbars=1," +
	"location=0,statusbar=0,menubar=0,resizable=0,width=250,height=200');"
	);
}

opener.location = "index.php?month=<?php echo $month ?>&year=<?php echo $year ?>";
window.setTimeout('window.close()', 1000);
</script>

 

I then have a body onload event set to call the emailWindow() function. Basically what happens is the original page loads, pops up a new page (using the emailWindow function), then closes the original page.

 

Some pop-up blockers prevent the pop-up page from opening. When this happens, I would like the original page to stay open so the user can click a link to manually open the pop-up page.

 

How would I go about doing this?

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.