Related Articles

7 users responded in this post

Subscribe to this post comment rss or trackback url
User Gravatar

[...] jQuery ajax error handling for $.get ,$.post, $.load methods | Php Development great read on handling Ajax Errors with jQuery (tags: programming javascript ajax tech error errors) [...]

User Gravatar
DaronWolff said in December 17th, 2009 at 4:11 pm

Excelent POST.
But i have a question. how can i detect the error if im using $.post or $.get

Thanks!!

User Gravatar
mahesh chari said in December 20th, 2009 at 9:00 pm

You can use same ,for post and get methods,but you have to specify the type of format in last parameter

$.get(url,parameter,callback,format)
then jquery automatically raise errors,accordingly

User Gravatar
Henson said in December 30th, 2009 at 2:59 am

I found that if you use $.ajax to make cross-domain ajax, you will never throw any errors.
Just like:
$.ajax({
type:”get”,
dataType: “jsonp”,
jsonp: “callback”,
url: apiurl,
data: params,
timeout: 1,
success:displayJSONResponse,
error: errorHandler
});

It’s so odd, I’m in depression.

Any help will be to appreciated.

User Gravatar
mahesh chari said in January 5th, 2010 at 9:15 pm

U have to use proxy for that cross site ajax.

Let us do post to proxy.php in server,then it can handle the request to other site.
you will get it

User Gravatar
rajesh said in February 4th, 2010 at 10:40 pm

Hi,
Suppose if my browser doesn’t support ajax , how can i find that one using Jquery ajax method.

User Gravatar
mahesh chari said in February 7th, 2010 at 7:26 pm

If browser don’t support ajax, then jQuery won’t call any errors.