当我尝试导入巴比伦文件时,我收到了错误消息:CORS策略阻止了对来自源“ null”的“ myfilepath”处的XMLHttpRequest的访问: 我对CORS一无所知,请向初学者介绍一下它。
1)通过CORS策略阻止从“ null”访问“ file:/// C:/Users/AJDA/Documents/Palatisation/web%20files/box.babylon”处的XMLHttpRequest:跨源请求被禁止仅协议方案支持:http,数据,chrome,chrome扩展名,https。
2)BJS-[17:27:13]:无法从box.babylon导入网格:importmesh of undefined from undefined version:undefined,exporter version:undefinedimportMesh JSON解析失败 m._ErrorEnabled @ babylon.js:1
答案 0 :(得分:1)
您好,这很不幸,但这是浏览器强制执行的安全性约束。只能通过本地主机上的网络服务器(例如apache,IIS等)为文件提供服务