rem: test("test global handlers - success", function() { expect(6); stop(); var counter = { complete: 0, success: 0, error: 0 }, success = function() { counter.success++ }, error = function() { counter.error++ }, complete = function() { counter.complete++ };  $('#foo').ajaxStart(complete).ajaxStop(complete).ajaxComplete(complete).ajaxError(error).ajaxSuccess(success);  $.ajax({url: "data/name.php", success: success, error: error, complete: function() { ok( counter.error == 0, 'Check succesful request' ); ok( counter.success == 2, 'Check succesful request' ); ok( counter.complete == 3, 'Check succesful request' ); counter.error = counter.success = counter.complete = 0; $.ajaxTimeout(500); $.ajax({url: "data/name.php?wait=5", success: success, error: error, complete: function() { ok( counter.error == 2, 'Check failed request' ); ok( counter.success == 0, 'Check failed request' ); ok( counter.complete == 3, 'Check failed request' ); start(); }}); }}); }); 
add: $('#first').load('data/test.html', function() { ok( $('#first').html().match(/^html text/), 'Check content after loading html' ); ok( testFoo == "foo", 'Check if script was evaluated after load' ); setTimeout(verifyEvaluation, 600); }); 
context: test("test global handlers - success", function() {	expect(6);	stop();	var counter = { complete: 0, success: 0, error: 0 },		success = function() { counter.success++ },		error = function() { counter.error++ },		complete = function() { counter.complete++ };	$('#foo').ajaxStart(complete).ajaxStop(complete).ajaxComplete(complete).ajaxError(error).ajaxSuccess(success);	// start with successful test	$.ajax({url: "data/name.php", success: success, error: error, complete: function() {	  ok( counter.error == 0, 'Check succesful request' );	  ok( counter.success == 2, 'Check succesful request' );	  ok( counter.complete == 3, 'Check succesful request' );	  counter.error = counter.success = counter.complete = 0;	  $.ajaxTimeout(500);	  $.ajax({url: "data/name.php?wait=5", success: success, error: error, complete: function() {	    ok( counter.error == 2, 'Check failed request' );	    ok( counter.success == 0, 'Check failed request' );	    ok( counter.complete == 3, 'Check failed request' );	    start();	  }});	}});});
meta: 5264	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5264/dc6f9cfc9cd0e2393b8f3087d8fcfa8e03260d4c/ajaxTest.js/clean/src/ajax/ajaxTest.js