0
<script>
$(document).ready(function() {
$.ajax({url: "http://somedomain/app/district.php", success: function(result){
$("#district").html(result);
}});
$.ajax({url: "http://somedomain/app/category.php", success: function(result){
$("#crop-category").html(result);
}});
$('#district').change(function(){
var value=$('#district').val();
$('#upazila').parent().find('span').html("<span> </span>");
$.ajax({
url: "http://somedomain/app/upazila.php",
type: "get", //send it through get method
data:{value},
success: function(response) {
$("#upazila").html(response);
},
error: function(xhr) {
//Do Something to handle error
}
});
});
});
</script>
これは私のjqueryコードです。 最初の2つのAjaxリクエストのために値を取得しましたが、要求を取得して変数を渡すとコードが機能しません。デバッグ気分でそれが キャッチされないでSyntaxError言う:予期しないトークン}のindex.html:36 phonegap ajaxは値で動作していません
データです:{値}、
が、それは助けてくださいブラウザ... で正常に動作します。