如下,demo1.html访问本地demo1.php文件时出现跨域问题,
解决:给浏览器传入启动参数(allow-file-access-from-files),允许跨域访问。
找到Chrome浏览器的快捷方式,右键访问“属性”:
在其后添加allow-file-access-from-files,如下,
"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" allow-file-access-from-files
然后重启浏览器,即可访问成功。