诚心求教~~~

skydg 2002-11-12 02:29:23
有两个域www.aaa.netwww.bbb.com都是指向同一个IP,请问如何用javascript 或 vbscript判断域名为aaa.net时跳到aaa.htm页面,为bbb.com时跳到bbb.asp页面?
...全文
73 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
icecoldy 2002-11-12
  • 打赏
  • 举报
回复
楼上的正解。
seabell 2002-11-12
  • 打赏
  • 举报
回复
<script>
currenthref=window.location.href;
if(currenthref=="http://www.aaa.net")
window.location.href="http://www.aaa.htm";
else if(currenthref=="http://www.bbb.com")
window.location.href="http://www.bbb.asp";
else alert(currenthref);
</script>

87,904

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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