Firefox 4.0 and Popups

Dec 9, 2010
75
0
0
Sunnyvale
Hey guys, I was hoping someone could provide a working popup that works in all browsers including firefox 4.0. I was using this one below but it stopped working within the new firefox, it just says are you sure you want to leave this page now or something.

Code:
<script type="text/javascript" language="javascript">
var areYouReallySure = false;
var internalLink = false;
function areYouSure() {
if (!areYouReallySure && !internalLink) {
areYouReallySure = true;
location.href=""
return "WAIT! Are you sure you want to miss out! Click cancel. \r\n ";
}
}
window.onbeforeunload = areYouSure;
</script>


Would appreciate the help!

Thanks
:food-smiley-010:
 


You can use this to still show the user a message. After it's displayed the default firefox box pops up asking if they want to leave.
HTML:
<script type="text/javascript">
message="My Exit Message";
</script>
<body onbeforeunload="alert(message); return false;">
 
Thanks for the info but ultimately that did not work. Unless I was supposed to take out my original popup script and enter that. Which would make it exclusively only workable if the person is exclusively using firefox 4.0? Hmmm. Is this firefox 4.0 still a beta?
 
The idea with the script above is that it runs the popup before firefox has a chance to show their bs.

And, no, firefox 4.0 is out nowadays (although I obviously don't know what you're using).
 
Could you guys just make the top say 5 pixels of the page horizontally linked to a lightbox that does something similar. When they mouse over the top left half of the page for example... the top 5 pixels as they are on their way to the back button.

Might not work for everyone, but functionally it would.
 
If you want a guaranteed pop-up just launch it as soon as the user interacts with something. Can't stop a popup that is tied to clicking an image/link/whatever.

<SCRIPT LANGUAGE="JavaScript">

function goNewWin() {


TheNewWin =window.open("http://www.rape_is_popping_up.com",'TheNewpop','toolbar=0, location=1, width=950, height=730, directories=1,status=1,menubar=0, scrollbars=0,resizable=1');

TheNewWin.blur();
}
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript">

function goToURL() { window.location = "http://innocent_link_on_my_website"; }

</script>



<input name="Button" type="button" onClick="goNewWin() + goToURL()" VALUE="Click Here!">

^^ that is a sample button you can use