一个简单的问题,请各位帮忙看看!

guojl 2010-10-27 01:10:13
我想实现 :用response.redirect "http://www.myweb1.com/"打开myweb1网站,如果这个网站打不开,则跳转到www.myweb2.com 请问我下面的代码对吗?请指教!!非常感谢!

<%
response.redirect "http://www.myweb1.com/"
If Err Then
err.Clear
response.redirect "http://www.myweb2.com"
End If
%>

...全文
42 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
hanbquan 2010-10-27
  • 打赏
  • 举报
回复
Set xmlHttp = Server.CreateObject("Microsoft.XMLHTTP")
xmlHttp.open "GET","http://www.myweb1.com/",false
xmlHttp.send
if xmlHttp.Status <> 200 then
response.redirect "http://www.myweb2.com"
else
response.redirect "http://www.myweb1.com"
end if

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧