...

View Full Version : Why is this being pop-up blocked?



jakerbug
08-18-2005, 02:42 PM
I have a site that gets an IE pop-up blocker warning when the pages loads, and I'm not quite sure why. The only suspect code I could find is this:


<script language="javascript" type="text/javascript">
if (navigator.appName.toLowerCase().indexOf("netscape")!=(-1)
&& navigator.appVersion.toLowerCase().indexOf("mac")!=(-1))
{
window.location = "m/default.html"
}
else if (navigator.appName.toLowerCase().indexOf("netscape")!=(-1)
&& navigator.appVersion.toLowerCase().indexOf("win")!=(-1))
{
window.location = "w/default.html"
}
else if (navigator.appName.toLowerCase().indexOf("microsoft internet explorer")!=(-1)
&& navigator.appVersion.toLowerCase().indexOf("mac")!=(-1))
{
window.location = "ie/mac"
}
</script>

<SCRIPT LANGUAGE="JavaScript">
var message="Welcome to Grayspire Web Design - The Pinnacle of Creative Marketing";
function statusbar()
{ window.status=message; visible=1; }
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript">
function coverbox() {
if (document.getElementById) { // DOM3 = IE5, NS6
document.getElementById('hidepage').style.visibility = 'hidden';
movie.location.reload();
}
else
{
if (document.layers) { // Netscape 4
document.hidepage.visibility = 'hidden';
}
else { // IE 4
document.all.hidepage.style.visibility = 'hidden';
}
}
}
</script>

I need the redirect portion there because of some subtle differences in CSS positioning between Windows and MAC OS's, and the "movie.location.reload" in the coverbox function needs to be there so that the small flash movie i have in an iframe will restart once all the graphics load and the page becomes visible.

Can anyone see something in the Javascript that is causing the Windows IE pop-up blocker to be triggered? There is no redirect in the script when the Windows/IE combination is present, so I'm not sure what the problem is. Could it be the "movie.location.reload" or do i need to add something in the redirect script to indicate that nothing needs to happen under Windows/IE? Or is it possibly something different all together?

Thanks!

jbot
08-18-2005, 03:23 PM
I have a site that gets an IE pop-up blocker warning when the pages loads

if you're trying to load a popup on page load, then that's why the popup-blocker kicks in. users don not like auto-popups, ie those not activated through user input. hence browser developers have changed their browsers to stop this abuse. that's why. :rolleyes:

martin_narg
08-18-2005, 03:35 PM
I need the redirect portion there because of some subtle differences in CSS positioning between Windows and MAC OS's, and the "movie.location.reload" in the coverbox function needs to be there so that the small flash movie i have in an iframe will restart once all the graphics load and the page becomes visible.

Better idea is to make your styling compatible across all browsers, or at least use filters to target specific browsers for individual css hacks.
CSS Filters (http://www.dithered.com/css_filters/css_only/index.php)

With regards to reloading the flash movie - standard JavaScript object referencing should resolve this problem across all browsers too.

Hope this helps.

m_n

jakerbug
08-18-2005, 03:37 PM
if you're trying to load a popup on page load, then that's why the popup-blocker kicks in. users don not like auto-popups, ie those not activated through user input. hence browser developers have changed their browsers to stop this abuse. that's why. :rolleyes:

i know how pop-ups work. the page doesn't have a pop-up. it has a redirect for MAC OS's, and it works fine.

the trouble is, either that redirect or the movie iframe reload is triggering the page to prompt the Windows/IE pop-up blocker, i believe. my question is, looking at the code, could one of those be the culprit, and if so, should i add something to the script that lets Windows/IE know that it's just supposed to stay put and not perform any redirection.

there is NO pop-up on the page...

jakerbug
08-18-2005, 03:41 PM
With regards to reloading the flash movie - standard JavaScript object referencing should resolve this problem across all browsers too.

martin, how would i do that exactly? i'm not great with javascript. i can mostly just alter other scripts, not come up with my own. do i edit anything flash-wise? name the movie in there or something? or is it all javascript?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum