我的网站在PC上运行良好,但是当我尝试使用“移动数据”从移动设备打开我的网站时,ajax请求无效。但是ajax可以使用Wifi连接。
它不仅是我的网络问题,而且还无法处理我的客户端移动数据。
我的网站上只有1个js文件,即JQuery 1.12.4。
我也在使用Cloudfare CDN。
这是我的代码。
$(document).ready(function(){
get_data();
});
function get_data(){
var link = "URL";
var pair = "value";
var period = "value";
$.ajax({
url:link,
type: "POST",
data : { pairID:pair,period:period }
}).done(function(data){
// response in HTML Table
});
}
PC chrome中的响应标头:
Cache-Control:max-age=2592000, private, must-revalidate
Cache-Control:no-store, no-cache, must-revalidate
CF-RAY:3c332594e5340e12-MXP
Connection:keep-alive
Content-Encoding:gzip
Content-Type:text/html; charset=UTF-8
Date:Sat, 25 Nov 2017 08:13:07 GMT
Expires:Thu, 19 Nov 1981 08:52:00 GMT
Pragma:no-cache
Server:cloudflare-nginx
Set-Cookie:ci_session=879fa6e9652b84d71b75a03f5b760c42339a501b; expires=Sat, 25-Nov-2017 10:13:06 GMT; Max-Age=7200; path=/; HttpOnly
Transfer-Encoding:chunked
Vary:Accept-Encoding,User-Agent
X-Powered-By:PHP/7.0.23
请求标题:
Accept:*/*
Accept-Encoding:gzip, deflate
Accept-Language:en-US,en;q=0.9
Connection:keep-alive
Content-Length:20
Content-Type:application/x-www-form-urlencoded; charset=UTF-8
Cookie: etc
Host: www.example.com
Origin:http://www.example.com
Referer:http://www.example.com/ind?id=1
User-Agent:Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36
X-Requested-With:XMLHttpRequest
答案 0 :(得分:0)
因为您可以使用.htaccess中的ip进行获取,发布和放置。请将其重命名为.htaccess_old,它应适用于所有设备。 #欢呼声