artHttp.prototype.gettext=function(charset){
try{
return this.b2s(this.content,charset ? charset : this.charset);
}catch(ex){
this.msg = ex.description;
return "";
}
};
_SmartHttp.prototype.getjson=function(charset){
try{
var _json=null;
eval("_json=(" + this.gettext(charset) + ");");
return _json;
}catch(ex){
this.msg = ex.description;
return null;
}
};
_SmartHttp.prototype.getxml=function(charset){
try{
var _dom = new ActiveXObject("MSXML2.DOMDocument");
_dom.loadXML(this.gettext(charset).replace("&","&"));
return _dom;
}catch(ex){
this.msg = ex.description;
return null;
}
};
_SmartHttp.prototype.getobj = function (){
var b=null;
var httplist = ["MSXML2.serverXMLHttp.3.0","MSXML2.serverXMLHttp","MSXML2.XMLHttp.3.0","MSXML2.XMLHttp","Microsoft.XMLHttp"];
for(var i = 0;i<=httplist.length -1;i++){
try{
b= new ActiveXObject(httplist[i]);
(function(o){
_SmartHttp.prototype.getobj = function(){return new ActiveXObject(o)};
})(httplist[i]);
return b;
}catch(ex){
//eval("this.msg = ex.description;");
}
}
return b;
};
_SmartHttp.prototype.getrnd = function (){return Math.random().toString().substr(2);};
_SmartHttp.prototype.b2s = function(bytSource, Cset){
var Objstream;
var byts;
Objstream =Server.CreateObject("ADODB.Stream");
Objstream.Type = 1;
Objstream.Mode = 3;
Objstream.Open();
Objstream.Write(bytSource);
Objstream.Position = 0;
Objstream.Type = 2;
Objstream.CharSet = Cset;
byts = Objstream.ReadText();
Objstream.Close();
Objstream = null;
return byts;
};
_SmartHttp.prototype.urlencode=function(str){ return encodeURIComponent(str);};
_SmartHttp.prototype.urldecode=function(str){ return decodeURIComponent(str);};
</script>