Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New Coder
    Join Date
    Mar 2004
    Location
    New Jersey
    Posts
    70
    Thanks
    2
    Thanked 1 Time in 1 Post

    Why is this being pop-up blocked?

    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:

    Code:
    <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!

  • #2
    Senior Coder
    Join Date
    Feb 2004
    Location
    Edinburgh
    Posts
    1,352
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Lightbulb you've answered the question yourself

    Quote Originally Posted by jakerbug
    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.
    Last edited by jbot; 08-18-2005 at 03:23 PM. Reason: added quote
    *keep it simple (TM)

  • #3
    Regular Coder martin_narg's Avatar
    Join Date
    Jul 2002
    Location
    Chamonix, France
    Posts
    600
    Thanks
    1
    Thanked 3 Times in 3 Posts
    Quote Originally Posted by jakerbug
    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

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

    Hope this helps.

    m_n
    "Cos it's strange isn't it. You stand in the middle of a library and go 'Aaaaaaaaaaaaaaaaggggggghhhhhhh!'
    and everybody just stares at you. But you do the same in an aeroplane, and everybody joins in."
    -Tommy Cooper

  • #4
    New Coder
    Join Date
    Mar 2004
    Location
    New Jersey
    Posts
    70
    Thanks
    2
    Thanked 1 Time in 1 Post
    Quote Originally Posted by jbot
    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.
    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...
    Last edited by jakerbug; 08-18-2005 at 03:43 PM.

  • #5
    New Coder
    Join Date
    Mar 2004
    Location
    New Jersey
    Posts
    70
    Thanks
    2
    Thanked 1 Time in 1 Post
    Quote Originally Posted by martin_narg
    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?
    Last edited by jakerbug; 08-18-2005 at 05:35 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •