发布于 2016-12-04 07:06:31 | 29 次阅读 | 评论: 0 | 来源: 网友投递
这里有新鲜出炉的Javascript教程,程序狗速度看过来!
JavaScript客户端脚本语言
Javascript 是一种由Netscape的LiveScript发展而来的原型化继承的基于对象的动态类型的区分大小写的客户端脚本语言,主要目的是为了解决服务器端语言,比如Perl,遗留的速度问题,为客户提供更流畅的浏览效果。
<%
function getHTTPPage(url)
dim http
set http=createobject("MSXML2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then
exit function
end if
getHTTPPage=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number<>0 then err.Clear
end function
'''''''以下处理字符
Function bytes2BSTR(vIn)
dim strReturn
dim i,ThisCharCode,NextCharCode
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function
%>
这两个函数你可以收藏起来,用处大得不得了.
<%
function qqhead(qq)
url="http://friend.qq.com/cgi-bin/friend/oicq_find?oicq_no="&qq
content=getHTTPPage(url)
if len(content)>6360 then '如果QQ无效,做一些处理,避免错误发生.
content=replace(mid(content,instr(content,"http://img.tencent.com"),38),"""","")
qqhead="<a href='http://friend.qq.com/cgi-bin/friend/user_show_info?ln="&qq&"' target='_blank'><img src='"&content&"' title='QQ:"&qq&"' border='0'></a>"
else
qqhead=""
end if
end function
'OK了,大功告成了.现在大家只要调用就行了.