context: 	ajax: function( s ) {		// TODO introduce global settings, allowing the client to modify them for all requests, not only timeout		s = jQuery.extend({			global: true,			ifModified: false,			type: "GET",			timeout: jQuery.timeout,			complete: null,			success: null,			error: null,			dataType: null,			url: null,			data: null,			contentType: "application/x-www-form-urlencoded",			processData: true,			async: true,			beforeSend: null		}, s);		// if data available		if ( s.data ) {			// convert data if not already a string			if (s.processData && typeof s.data != 'string')    			s.data = jQuery.param(s.data);			// append data to url for get requests			if( s.type.toLowerCase() == "get" )				// "?" + data or "&" + data (in case there are already params)				s.url += ((s.url.indexOf("?") > -1) ? "&" : "?") + s.data;		}		// Watch for a new set of requests		if ( s.global && ! jQuery.active++ )			jQuery.event.trigger( "ajaxStart" );		var requestDone = false;		// Create the request object		var xml = new XMLHttpRequest();		// Open the socket		xml.open(s.type, s.url, s.async);		// Set the correct header, if data is being sent		if ( s.data )			xml.setRequestHeader("Content-Type", s.contentType);		// Set the If-Modified-Since header, if ifModified mode.		if ( s.ifModified )			xml.setRequestHeader("If-Modified-Since",				jQuery.lastModified[s.url] || "Thu, 01 Jan 1970 00:00:00 GMT" );		// Set header so the called script knows that it's an XMLHttpRequest		xml.setRequestHeader("X-Requested-With", "XMLHttpRequest");		// Make sure the browser sends the right content length		if ( xml.overrideMimeType )			xml.setRequestHeader("Connection", "close");					// Allow custom headers/mimetypes		if( s.beforeSend )			s.beforeSend(xml);		if (s.global)		    jQuery.event.trigger("ajaxSend", [xml, s]);		// Wait for a response to come back		var onreadystatechange = function(isTimeout){			// The transfer is complete and the data is available, or the request timed out			if ( xml && (xml.readyState == 4 || isTimeout == "timeout") ) {				requestDone = true;				var status = jQuery.httpSuccess( xml ) && isTimeout != "timeout" ?					s.ifModified && jQuery.httpNotModified( xml, s.url ) ? "notmodified" : "success" : "error";				// Make sure that the request was successful or notmodified				if ( status != "error" ) {					// Cache Last-Modified header, if ifModified mode.					var modRes;					try {						modRes = xml.getResponseHeader("Last-Modified");					} catch(e) {} // swallow exception thrown by FF if header is not available					if ( s.ifModified && modRes )						jQuery.lastModified[s.url] = modRes;					// process the data (runs the xml through httpData regardless of callback)					var data = jQuery.httpData( xml, s.dataType );					// If a local callback was specified, fire it and pass it the data					if ( s.success )						s.success( data, status );					// Fire the global callback					if( s.global )						jQuery.event.trigger( "ajaxSuccess", [xml, s] );				// Otherwise, the request was not successful				} else {					// If a local callback was specified, fire it					if ( s.error ) s.error( xml, status );					// Fire the global callback					if( s.global )						jQuery.event.trigger( "ajaxError", [xml, s] );				}				// The request was completed				if( s.global )					jQuery.event.trigger( "ajaxComplete", [xml, s] );				// Handle the global AJAX counter				if ( s.global && ! --jQuery.active )					jQuery.event.trigger( "ajaxStop" );				// Process result				if ( s.complete ) s.complete(xml, status);				// Stop memory leaks				xml.onreadystatechange = function(){};				xml = null;			}		};		xml.onreadystatechange = onreadystatechange;		// Timeout checker		if(s.timeout > 0)			setTimeout(function(){				// Check to see if the request is still happening				if (xml) {					// Cancel the request					xml.abort();					if ( !requestDone ) onreadystatechange( "timeout" );					// Clear from memory					xml = null;				}			}, s.timeout);		// Send the data		xml.send(s.data);				// return XMLHttpRequest to allow aborting the request etc.		return xml;	},
meta: 5264	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5264/898ca3198b3297f68eb77ad128450ad8f952e15e/ajax.js/clean/src/ajax/ajax.js