2013-02-09 84 views
0

我在HTTPS页面上实现了jquery自动完成功能,并且对于除Internet Explorer之外的所有浏览器都可以正常工作。为什么IE会给出“显示所有内容”警告?如何以编程方式避免此警告?

在IE上,它不显示自动弹出列表并显示警告为“显示所有内容”。

我已经使用JSON进行跨域请求。

这里是我的代码:

function zipAutoCompletet(prefix){ 

      jQuery("#"+prefix+"_zip").autocomplete({ 

     source: function (request, response) { 
     $.getJSON("http://ws.geonames.org/postalCodeSearchJSON", 
      { 'postalcode_startsWith': request.term, maxRows: 12, style: "full" }, 
      function(data) { 
       if(data.postalCodes){ 
        var x = $.map(data.postalCodes, function(item){ 
         console.log(item) 
         return { 
            label: item.placeName + (item.adminCode1 ? ", " + item.adminCode1 : "") + ", " + item.postalCode + ", "+item.countryCode, 
            value: item.postalCode 
         } 
        }); 
        response(x); 
       } 
      } 
     );   
    }, 

任何一个可以告诉我,我怎么能在IE中启用自动完成也没有“显示所有内容”的警告?

谢谢提前。

回答

2

为了防止IE显示该消息,您需要拥有一切的安全,即一切都应该是https。

因此,我想尝试的第一件事是将您的json网址更改为https。

$.getJSON("https://ws.geonames.org/postalCodeSearchJSON",