http (Entry Nr. 263, by user 1 | edit) |
|
| // ge_readUrl : Returns the content of an Url
function ge_http()
{
this.xmlHttp = null;
this.get = function(Url,Handler)
{
// Mozilla, Opera, Safari and IE7:
if (typeof XMLHttpRequest != 'undefined') this.xmlHttp = new XMLHttpRequest();
if (!this.xmlHttp) // IE6 and older:
{
try{
this.xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
this.xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
this.xmlHttp = null;
}
}
}
if (!this.xmlHttp) return false;
this.xmlHttp.open('GET', Url, true); // parameter 3: false=block, true=async
this.xmlHttp.send(null);
if (this.xmlHttp.readyState==4) Handler();
else this.xmlHttp.onreadystatechange = Handler;
}
}
function ge_readUrl(Url, ReturnType)
{
var r="";
var xmlHttp = null;
// Mozilla, Opera, Safari and IE7:
if (typeof XMLHttpRequest != 'undefined') xmlHttp = new XMLHttpRequest();
if (!xmlHttp) // IE6 and older:
{
try{
xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch(e) {
try {
xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch(e) {
xmlHttp = null;
}
}
}
if (!xmlHttp) return false;
async=false;
xmlHttp.open('GET', Url, async); // parameter 3: false=block, true=async
xmlHttp.send(null);
if (ReturnType=="responseXML") return xmlHttp.responseXML;
return xmlHttp.responseText;
return r;
}
|
|
|
Create a new entry at this position
|
|
|