我在 Cordova CLI 上开发一个项目并在物理 iPhone 上编译应用程序,但在控制台中出现访问控制源错误。
这是消息:
[Error] Origin null is not allowed by Access-Control-Allow-Origin.
[Error] Failed to load resource: Origin null is not allowed by Access-Control-Allow-Origin. (bootstrap.min.css, line 0)
Run Code Online (Sandbox Code Playgroud)
该错误来自本地文件,也来自 ajax。
我的config.xml的配置是:
<?xml version='1.0' encoding='utf-8'?>
<widget android-versionCode="14" defaultlocale="es-ES" id="com..." version="2.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>TEXT</name>
<description>TEXT</description>
<author email="MYEMAIL" href="MYURL">
MYNAME
</author>
<content src="index.html" />
<access origin="*" />
<allow-navigation href="*" />
<preference name="windows-target-version" value="10.0" />
<preference name="KeyboardDisplayRequiresUserAction" value="false" />
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent …Run Code Online (Sandbox Code Playgroud)