0

我有幾個網站使用geoPlugin和微軟的IE更新後9/24/2012我有一些奇怪的問題。我第一次發現我的NIVO滑塊並沒有出現在我的網頁,所以我挖成控制檯找到geoPlugin undefine變量與IE

SCRIPT5009: 'geoplugin_countryCode' is undefined

然後我調試的同一頁面在谷歌Chrome和一切工作正常那裏。我試圖破譯有關該更新

這裏是我的javascript KB2744842公告:

<script src="https://ssl.geoplugin.net/javascript.gp" type="text/javascript"></script> 
<script type="text/javascript"> 
    $(document).ready(function() { 
     var country = geoplugin_countryCode(); 

     if(country === 'CA'){ 
      $('#notification').html('<div class="attention" style="display: none;">You are in Canada</div>'); 
      $('.attention').fadeIn('slow'); 
      $('html, body').animate({ scrollTop: 0 }, 'slow'); 
     }else if(country != 'US'){ 
      $('#notification').html('<div class="attention" style="display: none;">You are in the USA</div>'); 
      $('.attention').fadeIn('slow'); 
      $('html, body').animate({ scrollTop: 0 }, 'slow'); 
     }else{ 
      //nothing stupid IE 
     } 

    }); 
    $('.geoClose').live('click', function() { 
     console.log('geoplugin notify closed'); 
     document.cookie = 'geoClose=true;' 
    }); 
</script> 

HTML:

<div id="wrapper"> 
    <div id="header">Header Text</div> 
    <div id="notification"></div> 
    <div id="content">Content Here!</div> 
    <div id="footer"></div> 
</div>​ 

回答

0

geoPlugin最近改變了一些政策關於SSL請求,顯然IE瀏覽器將不跟隨在其他瀏覽器將執行重定向。

產生的代碼:

<script src="http://www.geoplugin.net/javascript.gp" type="text/javascript"></script> 
<script src="http://www.geoplugin.net/statistics.gp" type="text/javascript"></script> 
<!--<script src="https://ssl.geoplugin.net/javascript.gp" type="text/javascript"></script>--> 
<script type="text/javascript"> 
//<![CDATA[ 
    $(document).ready(function() { 
     var country = geoplugin_countryCode(); 

     if(country === 'CA'){ 
      $('#notification').html('<div class="attention" style="display: none;">You are in Canada</div>'); 
      $('.attention').fadeIn('slow'); 
      $('html, body').animate({ scrollTop: 0 }, 'slow'); 
     }else if(country != 'US'){ 
      $('#notification').html('<div class="attention" style="display: none;">You are in the USA</div>'); 
      $('.attention').fadeIn('slow'); 
      $('html, body').animate({ scrollTop: 0 }, 'slow'); 
     }else{ 
      //nothing stupid IE 
     } 

    }); 
    $('.geoClose').live('click', function() { 
     console.log('geoplugin notify closed'); 
     document.cookie = 'geoClose=true;' 
    }); 
//]]> 
</script>