asp转化为静态页面问题
我把asp转化为静态页面了,怎么不兼容其他浏览器啊,只能在ie中运行,请教转化代码为:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www. xmlns="http://www.
<head>
<title>生成静态首页..</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" /></head>
<body>
<%
dim url
'--------------------------------------------------------------------------
'该程序为 提供 版权归bbsgood官方所有
'说明
'该程序能将目标的动态访问地址生成HTML文件,从而提高访问速度
'比如,你目前的首页为index.asp文件,你可以通过该程序设置,生成index.html文件,并设置默认首页访问为index.html
'设置完下面的配置后,你可以定期访问 crhtml.asp程序,来更新你的html页面.
url= "http://127.0.0.1/chat50.asp" '生成静态页面的目标网址
file="chat.do" '要生成的文件名可以设置多种文件扩展名
Set xml=Server.createobject("MSXML2.XMLHTTP")
xml.Open "GET",""&url&"", False
xml.Send
if xml.readyState=4 then
DIM Htmlnl
Htmlnl=bytes2BSTR(xml.responsebody)
Htmlnl=trim(Htmlnl)
DIM myFile,fileStreamObj,textStream
Const ForReading = 1
Const Forwriting = 2
Const ForAppending = 8
SET fileStreamObj = CreateObject("Scripting.FileSystemObject")
myFile=server.MapPath(file)
fileStreamObj.CreateTextFile(myFile)
set textStream = fileStreamObj.OpenTextFile(myFile,ForWriting,False)
textStream.Write(HtmlNL)
textStream.Close()
Response.Write "成功 <a href="""&file&""" target=_blank>返回生成的页面</a>"
else
Response.Write "失败"
end if
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
%>
</body>
</html>