-test("jQuery.ajax() - success/error callbacks (remote)", function() {
-
- var supports = jQuery.support.cors;
-
- expect( supports ? 9 : 4 );
-
- jQuery.ajaxSetup({ timeout: 0 });
-
- stop();
-
- setTimeout(function(){
- jQuery('#foo').ajaxStart(function(){
- ok( true, "ajaxStart" );
- }).ajaxStop(function(){
- ok( true, "ajaxStop" );
- start();
- }).ajaxSend(function(){
- ok( supports , "ajaxSend" );
- }).ajaxComplete(function(){
- ok( true, "ajaxComplete" );
- }).ajaxError(function(){
- ok( ! supports, "ajaxError" );
- }).ajaxSuccess(function(){
- ok( supports, "ajaxSuccess" );
- });
-
- jQuery.ajax({
- // JULIAN TODO: Get an url especially for jQuery
- url: "http://rockstarapps.com/test.php",
- dataType: "text",
- beforeSend: function(){ ok(supports, "beforeSend"); },
- success: function( val ){ ok(supports, "success"); ok(supports && val.length, "data received"); },
- error: function(_ , a , b ){ ok(false, "error"); },
- complete: function(){ ok(supports, "complete"); }
- });
- }, 13);
-});
-