Your getting an error in that code because you need a comma after the success:function(){},
Also, make sure there is no comma after the last method in the object or IE throws an error. Josh Powell On Nov 26, 11:51 pm, WebAppDeveloper <[EMAIL PROTECTED]> wrote: > 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-tp20711274s27240p2... > Sent from the jQuery General Discussion mailing list archive at Nabble.com.