迪比斯喷枪:网页判断跳转

来源:百度文库 编辑:高考问答 时间:2024/04/29 20:56:49
我有2个主网页,分别在不同服务器,由于服务器iis经常出问题,我想问如果一个网页打不开了,自动跳转到另外一个,代码是什么?或者在另外一个服务器上做一个判断网页,判断那个能打开,就跳转到那个。

可以试试测速,哪个速度快就跳哪个,下面是参考代码,自己改改
把先面代码放入贵站适当位置即可!

<table width="100%" height="0" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="34" align="center" valign="middle" background="http://vane.9orange.com/images/speed_tb.gif">
<div align="center">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="8%"><div align="center"><img src="http://vane.9orange.com/images/dot_3.gif" width="11" height="7"></div></td>
<td width="92%"><strong><font color="#663300" class="big">测试我的网速</font></strong></td>
</tr>
</table>
</div></td>
</tr>
<tr>
<td align="center" valign="middle">
<div align="center">
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=524 HEIGHT=192>
<TR>
<TD ROWSPAN=1 COLSPAN=4 WIDTH=524 HEIGHT=30> <IMG NAME="TABLE0" SRC="http://vane.9orange.com/images/stable_top.gif" WIDTH=524 HEIGHT=30 BORDER=0 ></TD>
</TR>
<TR>
<TD WIDTH=8 HEIGHT=147 COLSPAN=1 ROWSPAN=1 background="http://vane.9orange.com/images/stable_lbk.gif">
</TD>
<TD WIDTH=485 HEIGHT=147 COLSPAN=1 ROWSPAN=1 background="http://vane.9orange.com/images/stable_bk.gif">
<!-- speed test code start-->
<script language="javascript" >
<!--
var TESTURL = "http://wanshow.com/speedtest.asp";
var MEMBERID = 986;

document.write("<table width='100%' border='0' cellpadding='4' cellspacing='0'><form action='' name='testguide' id='testguide' method='post'><tr><td><div align='right'><font color='#663300' class='big'>选择接入方式:</font></div></td>");
document.write("<td><select name='bbtypeid'><option value=0>---请选择---</option><option value=1>ADSL及天翼通512K</option><option value=2>ADSL及天翼通1M</option><option value=3>ADSL及天翼通2M</option><option value=4>上海有线通1M</option><option value=5>长城宽带</option><option value=6>网通宽带</option><option value=7>电信FTTB</option><option value=8>电信VDSL</option><option value=9>其他类型</option></select><input type='hidden' name='bg' value='FFFAF3'><input type='hidden' name='memberid' value='1'></tr>");
document.writeln("<tr><td><div align='right'></div></td><td colspan='2'> <strong><img src='http://vane.9orange.com/images/dot_2.gif' width='9' height='9'> <a href='http://vane.9orange.com/speed_20.asp' target='_top'>最后20个测速记录</a> </strong></td></tr>");
document.writeln("<tr><td> </td><td><div align='left'><img src='http://vane.9orange.com/images/button_test.gif' width='72' height='17' style='cursor:hand' onclick='guidesubmit();'>      <img src='http://vane.9orange.com/images/button_myspeed.gif' width='72' height='17' style='cursor:hand' onclick='parent.location.href=\"http://vane.9orange.com/speed_my.asp\";'></div></td></tr></table>");
document.writeln("<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%><form name='showspeed' method='post'><TR><TD COLSPAN=1 WIDTH=100% HEIGHT=1 valign='middle'> <div align='center'><center><font size='2' color='#009900'></font></center>");
document.writeln("<IFRAME name=testframe id=testframe src='' frameBorder=0 WIDTH=306 HEIGHT=36 scrolling=no></IFRAME>");
document.writeln("<BR></div></TD></TR></form></TABLE>");

document.testframe.location= TESTURL+ '?bg=FFFAF3';

function guidesubmit()
{
if (testguide.bbtypeid.value == 0) {
alert('请选择您的接入方式!');
return false;
}

testguide.action = TESTURL;
testguide.memberid.value = MEMBERID;
testguide.target = "testframe";
testguide.submit();
}
-->
</script>
<!-- speed test code over -->
</TD>
<TD WIDTH=3 HEIGHT=147 COLSPAN=1 ROWSPAN=1 background="http://vane.9orange.com/images/stable_rbk.gif"><img src="../../200411%B9%A4%D7%F7%BC%C7%C2%BC/vane/images/stable_rbk.gif" width="3" height="3">
</TD>
<TD WIDTH=28 HEIGHT=147 COLSPAN=1 ROWSPAN=1 valign="bottom">
<IMG NAME="TABLE4" SRC="http://vane.9orange.com/images/stable_right.gif" WIDTH=28 HEIGHT=147 BORDER=0 ></TD>
</TR>
<TR>
<TD ROWSPAN=1 COLSPAN=4 WIDTH=524 HEIGHT=15> <IMG NAME="TABLE5" SRC="http://vane.9orange.com/images/stable_down.gif" WIDTH=524 HEIGHT=15 BORDER=0 ></TD>
</TR>
</TABLE>
</div></td>
</tr>
<tr>
<td height="10" align="center" valign="middle"> <div align="center"></div></td>
</tr>
<tr>
<td height="30" align="center" valign="middle"><div align="center"></div></td>
</tr>
</table>

不能实现
既然你的IIS服务器都不能启动,根本就没有办法来进入判断的网页,除非你用第三个服务器来实现,对是否能访问特别的文件进行判断,然后再进入相关的页面!