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?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.