9***@qq.com
9***@qq.com
  • 发布:2019-04-29 17:52
  • 更新:2019-11-18 15:12
  • 阅读:1484

ajax在chrome下使用问题

分类:MUI
		mui.ajax('https://m.xiashutxt.com/search.html', {  
			data: {  
				searchkey: '无限恐怖',  
				searchtype: 'all'  
			},  
			dataType: 'html', //服务器返回json格式数据  
			type: 'post', //HTTP请求类型  
			timeout: 10000, //超时时间设置为10秒;  
			success: function(data) {  
				//服务器返回响应,根据响应结果,分析是否登录成功;  
				console.log(data);  
			},  
			error: function(xhr, type, errorThrown) {  
				//异常处理;  
				console.log(type);  
			}  
		});  

以上代码在APP端正常,使用chrome调试时提示:
Access to XMLHttpRequest at 'https://m.xiashutxt.com/search.html' from origin 'http://127.0.0.1:8848' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

这个网站不是我的,是别人的,请问有解决办法吗?

2019-04-29 17:52 负责人:无 分享
已邀请:
tinker_li

tinker_li - itititit

win下chrome有跨域问题,hbuilderx没有跨域问题。
mac下chrome有跨域问题,hbuilderx也有跨域问题。
https://ask.dcloud.net.cn/question/83213 这里边有同事的截图。

该问题目前已经被锁定, 无法添加新回复