2011-01-09 8 views
0

動作します。 does not executejQueryのAJAX呼び出しは文句を言わない私はこれを持っている

+2

エラーがあるかどうかを確認するには、 'error'ハンドラと' complete'ハンドラを追加してみてください。また、 '$( 'img')を使うこともできます。attr({src:" images/users/status/"+ savedPhoto})' –

+0

あなたはそれができないことを教えてくれましたが、それは何をしています! – Quentin

+0

@DavidDorward私はそれがfirebugで要求を行うのを見ることができます – Karem

答えて

2

"エラー"コールバックを追加してみてください。これは間違っていることをあなたに示します。

error: function(XMLHttpRequest, textStatus, errorThrown) { 
    console.error(errorThrown); 
} 
+0

\tエラーを追加しました:function(XMLHttpRequest、textStatus、errorThrown){ \t alert (textStatus); \t}アラートに「エラー」が表示されました。エラーが発生したときに私は未定義となり、xmlhttprequestはオブジェクトxmlhttprequestを取得します。 – Karem

+0

FirefoxまたはSafariを使用している場合は、 'console.error(errorThrown); –

+0

@afekenholm答えとして、これでエラーを見つけました。 – Karem

1

あなたがFirefoxやSafariで開発している場合は使用できます(XMLHttpRequestを、textStatus、errorThrown)

A function to be called if the request fails. The function is passed three arguments: The XMLHttpRequest object, a string describing the type of error that occurred and an optional exception object, if one occurred. Possible values for the second argument (besides null) are "timeout", "error", "notmodified" and "parsererror". This is an Ajax Event.This handler is not called for JSONP requests, because they do not use an XMLHttpRequest.

は、だからあなたのsuccessコールバックと同様に、この行を追加

エラーconsole.errorあなたのコードでスローされたエラーをデバッグする機能。

関連する問題