问题 自从谷歌浏览器升级到chrome94版本后,在非安全网站下通过请求本地接口就会出现以下错误: Access to XMLHttpRequest at 'http://127.0.0.1:10005/' from origin 'http://testing.hongyangcloud.com' has been blocked by CORS policy: The request client is not a secure context and the resource is in
1. Client browser short polling The most simple solution, client use Ajax to sends a request to the server in a short period circle, the server returns the latest data, then client according to the received data to update the UI. The advantage is si
一.传统 ajax跨域访问是一个老问题了,解决方法很多,比较常用的是JSONP方法,JSONP方法是一种非官方方法,而且这种方法只支持GET方式,不如POST方式安全. 即使使用jQuery的jsonp方法,type设为POST,也会自动变为GET. 官方问题说明: "script": Evaluates the response as JavaScript and returns it as plain text. Disables caching by appending a qu