1 2 3 4 5 6 7 8 9 10 11 12 13 14 | [size=1em]Function [size=1em]Bytes2BStr(vin)[size=1em]'二进制转字串 [size=1em] [size=1em]strreturn = [size=1em]"" [size=1em] [size=1em]for i = 1 to lenb(vin) [size=1em] [size=1em]thischarcode = ascb(midb(vin,i,1)) [size=1em] [size=1em]if thischarcode < &h80 then [size=1em] [size=1em]strreturn = strreturn & chr(thischarcode) [size=1em] [size=1em]else [size=1em] [size=1em]nextcharcode = ascb(midb(vin,i+1,1)) [size=1em] [size=1em]strreturn = strreturn & chr(clng(thischarcode) * &h100 + cint(nextcharcode)) [size=1em] [size=1em]i = i + 1 [size=1em] [size=1em]end if [size=1em] [size=1em]next [size=1em] [size=1em]Bytes2BStr = strreturn [size=1em]End [size=1em]Function |
1 2 3 4 5 6 7 8 9 10 11 | [size=1em] [size=1em]var [size=1em]xhr = window.XMLHttpRequest ? [size=1em]new [size=1em]XMLHttpRequest() : [size=1em]new [size=1em]ActiveXObject([size=1em]"microsft.xmlhttp"[size=1em]); [size=1em] [size=1em]xhr.open([size=1em]'get'[size=1em], [size=1em]'index.html'[size=1em], [size=1em]true[size=1em]); [size=1em] [size=1em]xhr.onreadystatechange = [size=1em]function [size=1em]() { [size=1em] [size=1em]if [size=1em](4 == xhr.readyState) { [size=1em] [size=1em]if [size=1em](200 == xhr.status || 0 == xhr.status) { [size=1em] [size=1em]//=========正常返回后的处理代码 [size=1em] [size=1em]} [size=1em] [size=1em]else [size=1em]alert([size=1em]'动态页出问题了~~'[size=1em]); [size=1em] [size=1em]} [size=1em] [size=1em]} [size=1em] [size=1em]xhr.send([size=1em]null[size=1em]); |
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |