Android上的Phonegap Internet连接问题

时间:2019-02-19 15:26:59

标签: javascript android jquery jsonp phonegap

我正在研究一个需要连接到页面并获取一些数据的项目。我使用JSONP,它在浏览器上很好地工作,但是当我用Phonegap Build编译它时,它失败了。 我的config.xml文件内容是:

<?xml version='1.0' encoding='utf-8'?>
<widget id="abcd.efgh" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
    <name>test app</name>
    <description>
       TestApp
    </description>
    <author email="info@testapp.ir" href="http://testapp.ir/">
        testapp
    </author>
    <plugin name="cordova-plugin-whitelist" spec="1.1.0" />
    <content src="index.html" />
    <access origin="*" />
    <allow-intent href="http://*/*" />
    <allow-intent href="https://*/*" />
    <allow-intent href="tel:*" />
    <allow-intent href="sms:*" />
    <allow-intent href="mailto:*" />
    <allow-intent href="geo:*" />



    <platform name="android">
      <allow-intent href="market:*" />
  <uses-permission android:name="android.permission.INTERNET" />
  <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
</platform>

</widget>

我还在索引页中使用了CSP标记:

<meta http-equiv="Content-Security-Policy" content="default-src * 'unsafe-inline' 'unsafe-eval'; script-src * 'unsafe-inline' 'unsafe-eval'; connect-src * 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src *; style-src * 'unsafe-inline';
">

但是仍然不起作用!

我在javascript的android版本上看到的错误是“ ParserError”和“未调用Jquery(回调)”!

0 个答案:

没有答案