を実行していない、私はAJAX REST通信をテストするためにこのコードを持っている:Chromeでこのコードを実行するPhoneGapのはAPK私のPhoneGapアプリでPOSTアクション
$(document).ready(function() {
$("#test").click(function() {
alert("OK");
$.ajax({
type: "GET",
data: {},
url: "http://localhost:8080/test-notifier-web/RegisterServlet",
});
});
});
<div class="row col-centered">
<button type="submit" id="test">Submit</button>
</div>
はOKですが、私は私のコンソールとすべての作品にログインします良い。私がcordova build android
とapkを構築し、私のGenymotionデバイスでそれをテストすると、私はサーバーからの応答を取得しません。ある時点で、Web経由でGenymotionブラウザを使ってテストするのはOKです。
私はこのコードで新しい空のアプリケーションを作成しました。これはapkとうまく動作しています。誰でも私を助けることができますか?
これは私のconfig.xmlにある:あなたがコンテンツ[セキュリティを追加する必要があり、あなたのconfig.xmlに
<allow-intent href="http://*/*" />
<allow-intent href="https://*/*" />
「を許可し、意図」メタ情報を追加する必要が
<?xml version='1.0' encoding='utf-8'?>
<widget id="it.paytas.mobile" version="1.0.0" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0">
<name>Paytas Mobile</name>
<description>
A blank PhoneGap app.
</description>
<author email="[email protected]" href="http://phonegap.com">
PhoneGap Team
</author>
<content src="index.html" />
<access origin="*" />
<preference name="DisallowOverscroll" value="true" />
</widget>
config.xmlとContent-Security-Policyを貼り付けてください。 – Eric
@Ericがconfig.xmlを投稿しました。どこにContent-Security-Policyがありますか? – slash89mf