javascript - 跨域读取阻塞 (CORB) 问题是准确的,即使我使用 JSONP
问题描述
我正在使用 JSONP 进行跨域但问题未解决
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<p id="p1">this text should be changed,when the button is clicked</p>
<div id="d1"></div>
<div id="d2"></div>
<div><img id="i1"></div>
<button>click here</button>
</body>
</html>
<script>
$(document).ready(function(){
$("button").click(function(){
$.ajax({
url: "http://theoneinfotech.com/new_the_one/sp_api/master_tbl/get_body_type",
dataType: "jsonp",
type:'GET',
success: function( response ) {
console.log( response ); // server response
}
});
});
});
</script>
api 工作正常,如果放在 Postman 或浏览器上但在这里不起作用(http://localhost/new)。如何解决它请帮助我。
提前致谢
问题是——
jquery.min.js:2 跨域读取阻止 (CORB) 阻止了跨域响应http://theoneinfotech.com/new_the_one/sp_api/master_tbl/get_body_type?callback=jQuery33104658196884971997_1548161549606&_=1548161549607与 MIME 类型 text/html。有关详细信息,请参阅https://www.chromestatus.com/feature/5629709824032768 。发送@jquery.min.js:2 ajax@jquery.min.js:2(匿名)@new:17 调度@jquery.min.js:2 y.handle@jquery.min.js:2
解决方案
推荐阅读
- c# - Android Emulator 未在 Xamarin Forms 上运行。每次运行 VS 2019 时都会取消构建
- python - 如何在 python 脚本和 iPhone 应用程序之间传递信息
- ruby-on-rails - Rails 5.2.3:Sidekiq Scheduler 给出 NameError: uninitialized constant in Production
- java - listview onitemclicklistener 在活动中无法使用
- amazon-web-services - 如何从 Amazon lex 获取星号 (*) 和哈希 (#) 到 Amazon Connect
- mysql - 如何在 SQL 中将表中的唯一值相加
- android - Google 应用内更新 API 未从 Play 商店更新最新版本的应用
- powerbi - 如何在 Power BI 中使用 Dax 获得嵌套平均值?
- amazon-web-services - 通过 API 为 AWS S3 授予第三方访问权限
- angularjs - 用于获取令牌的 AngularJS $http 标头