jsonp function not working

末鹿安然 提交于 2019-12-25 13:59:43

问题


I am receiving the below error on client site. I am using jsonp and a callback function. These are the headers I have set

Refused to execute script from 'http://example.com/wp-content/plugins/plugin-name/includes/core-file.php" because its MIME type ('access-control-allow-methods: get') is not executable, and strict MIME type checking is enabled.

I have set these headers under my plugin core file.

//Typical headers
header('Content-Type: text/html');
header( "content-type: text/javascript; charset=utf-8" ); 
send_nosniff_header();

//Allow Cross-Origin Resource Sharing
header("Access-Control-Allow-Origin: *");   
header("content-type: Access-Control-Allow-Methods: GET");

Please, can some one help me to resolve this! relevant link

来源:https://stackoverflow.com/questions/43115388/jsonp-function-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!