I would like to have this code in a separate file called XMLHttpReq.js:
[code]function getXMLHTTPRequest()
XMLHttpRequest-objekt
{
var req = false;
try
{
req = new XMLHttpRequest();
}
catch(err1)
{
try
{
req = new ActiveXObject(“Msxml2.XMLHTTP”);
}
catch(err2)
{
try
{
req = new ActiveXObject(“Microsoft.XMLHTTP”);
}
catch(err3)
{
req = false;
}
}
}
return req;
}
Then, in my TestAjax.js I would like to get the XMLHttpRequest object by calling the method:
[code]var http = getXMLHTTPRequest();
But I guess I have to import the first file into my TestAjax.js to be able to call the getXMLHTTPRequest method. How do I import the file?