0
実際、IOSプラットフォームのphonegapにajaxリクエストがあります。 example.com/folder/contact.php?id=idの2つのドメインがあり、もう1つは2です。example2.com/folder/contact.php?id=idios phonegapでクロスドメインが動作しない
URLが第2ドメイン(example2.com)、それは何も起こっていませんが、最初のドメイン(example.com)では正しく動作しています。私はconfig.xmlを設定しました。ここではアクセス元は "*"で、config.xmlにも設定されています。
何が問題なのか分かりません。私のAJAXコードは
$.ajax({
type: 'GET',
url: ""+localStorage.url+"/folder/contact.php?id=" + Id,
\t dataType: 'json',
\t crossDomain: true,
\t
data: {
name: name,
ph: ph,
email:email,
},
success: function(response) {
\t \t alert(response);
},
error: function(error) {
\t \t
navigator.notification.alert('Could not connect to the database');
}
});
ですが、同じことは、Androidプラットフォームのために働いています。私のコードで何が間違っているか教えてください