![](/img/trans.png)
[英]Angular 6 : Refused to execute script from 'URL' because its MIME type( ) is not executable, & strict MIME type checking is enabled
[英]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 類型檢查。”
我的代碼如下。
<!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>
您提供的 URL ( https://www.google.com/finance/converter?a=1&from=INR&to=USD&jsoncallback=?
) 似乎指向一個 HTML 頁面。 該錯誤非常不言自明。 我聽說谷歌貨幣轉換器不再在線。 請嘗試其他一些 API,可能類似於JsonRates
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.