service.js 924 Bytes
if (typeof (nBildertool) === 'undefined')
	nBildertool = {};

nBildertool.req = null;

nBildertool.service = function (url, callback)
{
	// erstellen des requests

	try
	{
		nBildertool.req = new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			nBildertool.req = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				nBildertool.req = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (failed)
			{
				nBildertool.req = null;
			}
		}
	}

	if (nBildertool.req == null)
		alert("Error creating request object!");

	nBildertool.req.open("GET", url, true);

	// Beim abschliessen des request wird diese Funktion ausgeführt
	if (typeof (callback) === 'undefined')
		nBildertool.req.onreadystatechange = nBildertool.cbCommon;
	else
		nBildertool.req.onreadystatechange = callback;

	nBildertool.req.setRequestHeader("Content-Type",
			"application/x-www-form-urlencoded");

	nBildertool.req.send(null);
}