<script language=vbscript defer>
function rsB(vIn)
rsB=MidB(vIn,1)
end function
function vbChar(ss)
vbChar=Chr(ss)
end function
function rep(str)
rep=replace(str,vbcrlf,"<br>")
end function
</script>
<script language=javascript defer>
function htmlEncode(strS){
return(strS.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/ /g," ").replace(/\n/g,"<br\/>"));
}
function htmlDecode(strS){
return(strS.replace(/<br \/>/ig,"\r\n").replace(/ /ig," ").replace(/>/ig,">").replace(/</ig,"<").replace(/&/ig,"&"));
}
var glbEncode=new Array();
function reCode(b){
var t=rsB(b)+rsB("\n");
t=escape(t).replace(/%u/g,"").replace(/(.{2})(.{2})/g,"%$2%$1").replace(/%([A-Z].)%(.{2})/g,"@$1$2");
t=t.split("@");
var i=0,j=t.length,k;
while(++i<j)
{
k=t[i].substring(0,4);
if(!glbEncode[k])glbEncode[k]=escape(vbChar(eval("0x"+k))).substring(1,6);
t[i]=glbEncode[k]+t[i].substring(4);
}
return rep(unescape(t.join("%")));
}
function $(id) {
return document.getElementById(id);
}
function getnum(url,obj)
{
var xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
xmlhttp.onreadystatechange=requestdata;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
function requestdata(){
if(xmlhttp.readyState==4)
{
if(xmlhttp.status==200)
{
$(obj).innerHTML=reCode(xmlhttp.responseBody);
}
}
}
}
getnum("ajax.htm","show");
</script>
<div id="show">here will be showed something...</div>
posted on 2006-07-15 16:58
汪杰 阅读(191)
评论(0) 编辑 收藏 引用