此请求已被阻止;内容必须通过HTTPS提供 This request has been blocked; the content must be served over HTTPS.

时间:2025-01-25 09:05:31
 $.getScript("http://./ipquery", function () {
            (localAddress);//返回对象Object{city:"南昌市",province:"江西省"}
            province = localAddress["province"];
            province = (/省/, '');
            city = localAddress["city"];
            city = (/市/, '');
            (province);//江西
            (city);//南昌
        });

只需更改你的url变量中 http// // ,当页面加载http时,ajax请求将使用http协议,如果加载https,浏览器将ajax请求协议设置为https。即,您的代码应如下所示:

 $.getScript("//./ipquery", function () {
            (localAddress);//返回对象Object{city:"南昌市",province:"江西省"}
            province = localAddress["province"];
            province = (/省/, '');
            city = localAddress["city"];
            city = (/市/, '');
            (province);//江西
            (city);//南昌
        });