我使用PhoneGap Build来远程构建我的应用程序 . 我使用AjaxForm,它在从Phonegap Build构建的Android App上运行良好 . 但是同样的AJAX功能在iOS应用程序上不起作用 .
这是我的config.xml
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.com.com" version="1.3.0" xmlns="http://www.w3.org/ns/widgets" xmlns:android="http://schemas.android.com/apk/res/android" xmlns:gap="http://phonegap.com/ns/1.0">
<name>name</name>
<description>
description
</description>
<author email="support@phonegap.com" href="http://phonegap.com">
MyName
</author>
<access origin="*" />
<access launch-external="yes" origin="tel:*" />
<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
<allow-navigation href="data:*" />
<access minimum-tls-version="TLSv1.1" origin="*" requires-certificate-transparency="true" requires-forward-secrecy="false" />
<platform name="android">
<allow-intent href="market:*" />
</platform>
<platform name="ios">
<allow-intent href="market:*" />
<allow-navigation href="http://*/*" />
<allow-navigation href="https://*/*" />
<allow-navigation href="data:*" />
<allow-intent href="*" />
<allow-navigation href="*" />
<allow-intent href="tel:*" />
<allow-intent href="sms:*" />
<allow-intent href="mailto:*" />
<allow-intent href="geo:*" />
</platform>
<engine name="android" spec="~7.0.0" />
<engine name="ios" spec="^4.5.4" />
</widget>
我已经尝试了几种我在StackOverflow中找到的解决方案但是所有这些解决方案都没有起作用 . 在 document ready
函数之后我试着 alert()
一个字符串,警报根本不起作用 . 我尝试将 <body>
标签中的所有脚本放入 <head>
但它没有任何效果 .
我也尝试添加
<meta http-equiv="Content-Security-Policy" content="default-src *; style-src 'self' 'unsafe-inline'; script-src 'self' 'unsafe-inline' 'unsafe-eval'"/>
在我的 index.html
中打开 <head>
标签之后,但仍然没有结果 . 我在网上找到的大多数解决方案都已过时 .
请帮忙谢谢