2016-06-15 9 views
0

私はjquery.mobileとcordovaでAndroid cordovaアプリケーションを開発しています Webサービス用に$ ajaxを呼び出しています。以下はコードスニペットです。

$.ajax({ 
      "url": serverPath+"/taxiws/clients/saveclient", 
      "type": "POST", 
      contentType: "application/json", 
      dataType: "json", 
      "data": JSON.stringify(obj), 
      "success": function(data) { 
       alert("success!!! "+data); 
       window.localStorage.setItem('client', JSON.stringify(obj)); 
      $("#LoadingBackgroundPopup").hide(); 

      window.location.href="reservationclient.html"; 

}, "error": function(error,jqXHR, textStatus){ 

    alert("erreur "+textStatus+JSON.stringify(jqXHR)); 
    } 
}); 

その、このエラーで応答:

error{"readyState":4",responseText":"","status":403,"statusText":"Interdit"} 

このコード何が間違っているのですか?なぜそれは働いていないのですか?任意の助け、提案は高く評価されます

ありがとうございます。

+0

の問題はサーバー側からです。 403は、Ajaxリクエストが禁止されていることを意味します。 –

+0

同じWebサービスを別のサーバーで使用している場合、どうすればこのエラーを解決できますか? –

+0

サーバでajaxリクエストを有効にしてください。いくつかの制限を加える必要があります。削除してください。 –

答えて

関連する問題