rem: ((wgServer == null) ? (wgScriptPath + "/index.php") : wgScript) + 
add: ((wgScript == null) ? (wgScriptPath + "/index.php") : wgScript) + 
context: function sajax_do_call(func_name, args, target) {	var i, x, n;	var uri;	var post_data;	uri = wgServer +		((wgServer == null) ? (wgScriptPath + "/index.php") : wgScript) +		"?action=ajax";	if (sajax_request_type == "GET") {		if (uri.indexOf("?") == -1)			uri = uri + "?rs=" + encodeURIComponent(func_name);		else			uri = uri + "&rs=" + encodeURIComponent(func_name);		for (i = 0; i < args.length; i++)			uri = uri + "&rsargs[]=" + encodeURIComponent(args[i]);		//uri = uri + "&rsrnd=" + new Date().getTime();		post_data = null;	} else {		post_data = "rs=" + encodeURIComponent(func_name);		for (i = 0; i < args.length; i++)			post_data = post_data + "&rsargs[]=" + encodeURIComponent(args[i]);	}	x = sajax_init_object();	if (!x) {		alert("AJAX not supported");		return false;	}	try {		x.open(sajax_request_type, uri, true);	} catch (e) {		if (window.location.hostname == "localhost") {			alert("Your browser blocks XMLHttpRequest to 'localhost', try using a real hostname for development/testing.");		}		throw e;	}	if (sajax_request_type == "POST") {		x.setRequestHeader("Method", "POST " + uri + " HTTP/1.1");		x.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");	}	x.setRequestHeader("Pragma", "cache=yes");	x.setRequestHeader("Cache-Control", "no-transform");	x.onreadystatechange = function() {		if (x.readyState != 4)			return;		sajax_debug("received (" + x.status + " " + x.statusText + ") " + x.responseText);		//if (x.status != 200)		//	alert("Error: " + x.status + " " + x.statusText + ": " + x.responseText);		//else		if ( typeof( target ) == 'function' ) {			target( x );		}		else if ( typeof( target ) == 'object' ) {			if ( target.tagName == 'INPUT' ) {				if (x.status == 200) target.value= x.responseText;				//else alert("Error: " + x.status + " " + x.statusText + " (" + x.responseText + ")");			}			else {				if (x.status == 200) target.innerHTML = x.responseText;				else target.innerHTML= "<div class='error'>Error: " + x.status + " " + x.statusText + " (" + x.responseText + ")</div>";			}		}		else {			alert("bad target for sajax_do_call: not a function or object: " + target);		}		return;	}	sajax_debug(func_name + " uri = " + uri + " / post = " + post_data);	x.send(post_data);	sajax_debug(func_name + " waiting..");	delete x;	return true;}
meta: 7966	/local1/tlutelli/issta_data/temp/all_js/javascript/2007_temp/2007/7966/cda698d24793837749a8bc14eae3fd2d3a8ea0fd/ajax.js/buggy/skins/common/ajax.js