Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 拒绝执行脚本,因为其MIME类型(';text/html';)不是可执行的AJAX DJANGO_Javascript_Django - Fatal编程技术网

Javascript 拒绝执行脚本,因为其MIME类型(';text/html';)不是可执行的AJAX DJANGO

Javascript 拒绝执行脚本,因为其MIME类型(';text/html';)不是可执行的AJAX DJANGO,javascript,django,Javascript,Django,我有一个Django应用程序运行良好。 但我在console中不断遇到这个错误: Refused to execute script from 'http://localhost:8000/live/detect/static/JS/livedetect.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled. 我尝试了堆栈中的答案,但我找不到问题所在

我有一个Django应用程序运行良好。
但我在console中不断遇到这个错误:

Refused to execute script from 'http://localhost:8000/live/detect/static/JS/livedetect.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
我尝试了堆栈中的答案,但我找不到问题所在

这是脚本文件

函数fetchData(){
csrfToken=$('#主卡')。数据(“令牌”);
$.ajax({
url:document.url,
async:true,
数据类型:“json”,
数据:{
csrfmiddlewaretoken:csrfToken,
},
键入:“post”,
成功:功能(响应){
$('#ExtractedText').text(response[“text”]);
}
});
}
$(文档).ready(函数(){
setInterval(fetchData,1000);
});