Javascript 拒绝执行脚本,因为其MIME类型(';text/html';)不是可执行的AJAX DJANGO
我有一个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. 我尝试了堆栈中的答案,但我找不到问题所在
但我在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);
});