如何让jQuery的HTTPS调用,而忽略UWP应用
问题描述:
我必须做出HTTPS在JavaScript函数,我通过使用ScriptNotify UWP应用程序调用调用SSL错误,如何让jQuery的HTTPS调用,而忽略UWP应用
function testHttpsCall() {
try {
$.ajax({
type: "GET",
url: "https://differentdomain.com/test/12",
success: function(data, status, xhr) {
console.log(data);
},
error: function(error) {
console.log(error);
},
complete: function() {
console.log("Comes here");
}
});
} catch (error) {
console.log(error);
}
}
它不是来到请求中的任何一个代码块,因为我无法调试移动设备上的混合应用程序我无法找到问题。
答
你应该几乎从不尝试联系不同的服务器,然后是你正在托管你的应用程序。在极少数情况下,当其他服务器必须明确允许您的页面通过设置适当的CORS标头来发出请求。
@ Marcin是在该服务器上启用了CORS – John
那么您面临的确切错误是什么? –
那就是我无法知道的 – John