相关疑难解决方法(0)

在Chrome中停用相同的来源政策

有没有办法在Google的Chrome浏览器上禁用同源策略

这是严格的开发,而不是生产用途.

javascript ajax google-chrome

1443
推荐指数
29
解决办法
177万
查看次数

Chrome-Fetch API无法加载文件。解决方法

我有以下两个文件:

index.html

<html>
<head>
<meta charset="utf-8" />
<title>Web Page</title>
<style type="text/css">
.text {
    display: inline-block;
    font-family: tahoma;
    font-size: 14px;
    max-width: 400px;
    background-color: #ddedff;
    padding: 10px;
    text-align: justify;
}
</style>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
    get_data('info.txt');
});
function get_data(file) {
    var request = new Request(file);
    fetch(request).then(function(response) {
        return response.text().then(function(text) {
            $('.text').html(text);
        });
    });
}
</script>
</head>
<body>
    <div class="text"></div>
</body>
<html>
Run Code Online (Sandbox Code Playgroud)

info.txt

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's …
Run Code Online (Sandbox Code Playgroud)

javascript firefox google-chrome fetch-api

7
推荐指数
1
解决办法
7991
查看次数

标签 统计

google-chrome ×2

javascript ×2

ajax ×1

fetch-api ×1

firefox ×1