我正在使用jsonp从跨域服务器获取数据,内容类型为text / html。当我将URL https://user.redact.com/address-book?callback=processData加载到本地的脚本标签中时,它可以正常工作,并且我得到的数据是这样的。
<script>
function fireThis(obj) {
console.log(obj)
}
</script>
<script src="https://user.redact.com/address-book?callback=fireThis"></script>
但是当我将此代码以.html文件上传到服务器并尝试从Web服务器运行该文件时,我在JSON对象中遇到错误,无法获取数据。