What about $.load() callback? Seems like its called in all possible
cases. The only disadvantage is error checking - is there any helper
in jQuery to check textStatus for error? This one is not particularly
beautiful.
if (textStatus == 'error' || textStatus == 'timeout' || textStatus ==
'parsererr
No problem, glad to help.
-T.J.
On Dec 9, 1:12 pm, Cameron van den Bergh
wrote:
> Thank you for this information, indeed, i was using $.get.
>
> On 9 déc, 18:13, "T.J. Simmons" wrote:
>
>
>
> > Are you using $.ajax or one of the other AJAX functions? $.get and the
> > rest only execute a callba
Thank you for this information, indeed, i was using $.get.
On 9 déc, 18:13, "T.J. Simmons" wrote:
> Are you using $.ajax or one of the other AJAX functions? $.get and the
> rest only execute a callback upon success; you'll need to use $.ajax
> if you want a callback for an error.
>
> http://docs.
Are you using $.ajax or one of the other AJAX functions? $.get and the
rest only execute a callback upon success; you'll need to use $.ajax
if you want a callback for an error.
http://docs.jquery.com/Ajax/jQuery.get#urldatacallbacktype has some
more information on that.
-T.J.
On Dec 9, 6:30 am,
Hi,
I'll just followup on my own statement.. I found the solution I was looking
for.
when calling $.ajax it has an event called error you can act on.
error: function( XMLHttpRequest, textStatus, errorThrown )
the XMLHttpRequest has a method called responseText which is the actually
text that the
I also deal with JSON almost exclusively (albiet in .NET, but getting
the server side error would be the same)
since $.getJSON doesn't handle error events, I wrote this simple
wrapper around the $.ajax function
GetAjax = function(url, params, success, error) {
var CallParams = {};
CallPa
> jQuery.ajax({
> type: 'GET',
> url: "http://picasaweb.google.com/data/feed/base/user/
> picasa_non_esistent_user?kind=album&alt=json",
> dataType: 'jsonp',
> error: function (xhr, ajaxOptions, thrownError) {
> alert("error triggered");
> if
On Dec 15, 3:06 am, MareceK wrote:
> Solution:
>
> error: function (xhr, ajaxOptions, thrownError) {
> if(xhr.status == 404) {
> // 404 error
> }
jQuery.ajax({
type: 'GET',
url: "http://picasaweb.google.com/data/feed/base/user/
picasa_non_esistent_user?kind=album&alt=jso
Solution:
error: function (xhr, ajaxOptions, thrownError) {
if(xhr.status == 404) {
// 404 error
}
else if(xhr.status == 403) {
// 403 error
}
else {
// default error
}
}
On 17. Nov, 03:12 h., Mike Alsup wrote:
> > errorThrown is for JavaScript errors (think try/catch).
> errorThrown is for JavaScript errors (think try/catch). 40X responses
> are not "thrown", they are just errors returned from the server and
> you can get details from the xhr (ie: xhr.statusText).
To elaborate slightly, the server could return an XML document with a
200 status code. But if th
> $.ajax({
> async: true,
> url: testingURL,
> success: function () {
> location.reload();
> },
> error: function (XMLHttpRequest,
The documentation for the ajax error function has this note in the example:
// typically only one of textStatus or errorThrown
// will have info
( http://docs.jquery.com/Ajax/jQuery.ajax#toptions )
Perhaps check the textStatus as well as the errorThrown?
Karl Rudd
On Mon, Nov 17, 2008 at
12 matches
Mail list logo