2017-04-17 183 views
-1

我有一个简单的html文件保存在我的桌面上。这个html文件需要发送链接到json文件(存储在azure blob中)到本网页中包含的应用程序。网页阻止跨源请求:...........................。 (原因:缺少CORS头'Access-Control-Allow-Origin')

<script> 
var zbc = "https://blobtempdemo.blob.core.windows.net/path/to_required_file.json"; 
require(['scripts/SampleApp/App'], function(App) 
{ 
App.start(abc); 
}); 

脚本部分JSON文件存储在微软Azure的blob。当我运行在Mozilla Firefox的网页,它会发出警告说

警告

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://blobtempdemo.blob.core.windows.net/path/to_required_file.json. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). 

的应用程序/网页完美的作品,当所有的文件都保存在我的桌面上。 当我在Firefox中粘贴url时,它可以获取文件并询问我是否要下载它。但是当文件位于blob中并且我打开此网页时它不起作用。

任何帮助?

回答

相关问题