最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Cross-domain error with Chrome in local dev only. How to resolve? - Stack Overflow

programmeradmin0浏览0评论

I'm getting the cross-domain error on my local machine (although the code works perfectly on our web server). This is a real pain in the butt for development, so what I'm wondering is this - can I adjust a setting in Chrome to not get that error locally anymore?

It's this one:

Unsafe JavaScript attempt to access frame with URL file:///Users/david/login.html from frame with URL file:///Users/david/varReturn.html. Domains, protocols and ports must match.

Thanks!

I'm getting the cross-domain error on my local machine (although the code works perfectly on our web server). This is a real pain in the butt for development, so what I'm wondering is this - can I adjust a setting in Chrome to not get that error locally anymore?

It's this one:

Unsafe JavaScript attempt to access frame with URL file:///Users/david/login.html from frame with URL file:///Users/david/varReturn.html. Domains, protocols and ports must match.

Thanks!

Share Improve this question asked Sep 21, 2012 at 1:51 maskedbaconmaskedbacon 1434 silver badges15 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 9

Google has decided that offline file access is cross-domain, regardless. You can try running chrome with --allow-file-access-from-files. I encountered the same problem when reading text files from the same folder using JavaScript.

发布评论

评论列表(0)

  1. 暂无评论