简体   繁体   English

拒绝从 'URL' 执行脚本,因为它的 MIME 类型 ('text/html') 不可执行,并且启用了严格的 MIME 类型检查

[英]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.

相关问题 Angular 6:拒绝从“URL”执行脚本,因为它的 MIME 类型()不可执行,并且启用了严格的 MIME 类型检查 - Angular 6 : Refused to execute script from 'URL' because its MIME type( ) is not executable, & strict MIME type checking is enabled 启用了严格的 mime 类型检查,拒绝执行来自 ' 的脚本<url> ' 它的 mime 类型 ('text/plain') 是不可执行的,并且</url> - strict mime type checking is enabled, refused to execute script from '<url>' its mime type ('text/plain') is not executable, and 拒绝从“ file_name.php”执行脚本,因为其MIME类型(“ text / html”)不可执行,并且启用了严格的MIME类型检查 - Refused to execute script from 'file_name.php' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled GeoJSON 文件:拒绝执行脚本,因为其 MIME 类型 (&#39;&#39;) 不可执行,并且启用了严格的 MIME 类型检查 - GeoJSON file: Refused to execute script from because its MIME type ('') is not executable, and strict MIME type checking is enabled 拒绝执行脚本,因为 MIME 类型('text/html')不可执行,并且启用了严格的 MIME 类型检查 - Refused to execute script because MIME type ('text/html') is not executable, and strict MIME type checking is enabled 拒绝执行脚本,因为它的 MIME 类型 ('application/gzip') 不可执行,并且启用了严格的 MIME 类型检查 - Refused to execute script because its MIME type ('application/gzip') is not executable, and strict MIME type checking is enabled 拒绝应用“ <URL> &#39;,因为它的MIME类型(&#39;text / html&#39;)不是受支持的样式表MIME类型,并且启用了严格的MIME检查 - Refused to apply style from '<URL>' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled 拒绝从&#39;*&#39;执行脚本,因为它的MIME类型(&#39;application / json&#39;)不可执行,并且严格的MIME类型为che - getting Refused to execute script from '*' because its MIME type ('application/json') is not executable, and strict MIME type che 拒绝从...应用样式,因为它的 MIME 类型 (&#39;text/html&#39;) 不是受支持的样式表 MIME 类型,并且启用了严格的 MIME 检查 - Refused to apply style from... because its MIME type ('text/html') is not a supported style-sheet MIME type, and strict MIME checking is enabled 拒绝从“http://127.0.0.1:5500/”执行脚本,因为它的 MIME 类型(“text/html”)不可执行 - Refused to execute script from 'http://127.0.0.1:5500/' because its MIME type ('text/html') is not executable
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM