Hi,

I have the following code below where I'm trying to dynamically check if an
AJAX request error occurs. If an error occurs, do something; otherwise, do
something else (if it's a success). But according to jQuery.com, they say
"You can never have both an error and a success callback with a request."
And that's why I'm getting an error when running the code below. Is there a
way to solve this?

$(document).ready(function() {
        $.ajax({
           type: "GET",
           url: "SomeProcessPage.cfm",
           data: "FirstName=Jerry&LastName=Young",
           success: function(data) {
                    $(data).appendTo("#myDivId");
               }
           error: function(XMLHttpRequest, textStatus, errorThrown){
           $("#msg").ajaxError(function(event, request, settings){
                        $(this).append("<li>Error requesting page " + 
settings.url + "</li>");
                });
           }
      });
});
-- 
View this message in context: 
http://www.nabble.com/error-option-for-jQuery.ajax-tp20711274s27240p20711274.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.

Reply via email to