[英]Refused to execute script from 'URL' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled
I'm getting error as "Refused to execute script from 'URL' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled."我收到错误消息“拒绝从 'URL' 执行脚本,因为它的 MIME 类型 ('text/html') 不可执行,并且启用了严格的 MIME 类型检查。”
My code is as below.我的代码如下。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
<title>Untitled Page</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$.ajax({
url: "https://www.google.com/finance/converter?a=1&from=INR&to=USD&jsoncallback=?",
type: "GET",
contentType: "application/javascript",
cache: false,
dataType: "jsonp",
success : function(response){
alert("Hi");
}
});
});
</script>
</head>
<body>
</body>
</html>
The URL you have provided ( https://www.google.com/finance/converter?a=1&from=INR&to=USD&jsoncallback=?
) seems to point to a HTML page.您提供的 URL (
https://www.google.com/finance/converter?a=1&from=INR&to=USD&jsoncallback=?
) 似乎指向一个 HTML 页面。 The error is very much self explanatory.该错误非常不言自明。 I hear that google currency converter is no longer online.
我听说谷歌货币转换器不再在线。 Please try some other API may be like JsonRates
请尝试其他一些 API,可能类似于JsonRates
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.