diff --git a/guide/english/jquery/jquery-ajax-get-method/index.md b/guide/english/jquery/jquery-ajax-get-method/index.md index 7f366c400c..61dee6a542 100644 --- a/guide/english/jquery/jquery-ajax-get-method/index.md +++ b/guide/english/jquery/jquery-ajax-get-method/index.md @@ -26,13 +26,18 @@ $.get('http://example.com/resource.json', {category:'client', type:'premium'}, f $("#mypar").html(response.amount); }); ``` +However, `$.get` doesn't provide any way to handle error. -The above example can also be written as: +The above example (with error handling) can also be written as: ```javascript $.get('http://example.com/resource.json', {category:'client', type:'premium'}) .done(function(response) { alert("success"); $("#mypar").html(response.amount); + }) + .fail(function(error) { + alert("error"); + $("#mypar").html(error.statusText); }); ```