<script>
try {
if( self.location == "http://域名一/index.html" )
{
top.location.href = "http://域名一/目录";
}
else if( self.location == "http://域名二/index.html" )
{
top.location.href = "http://域名二/目录";
}
else
{
document.write("错误的网址")
}
catch(e){}
</script>
JavaScript多域名转向
最新推荐文章于 2025-12-22 19:57:02 发布
本文介绍了一段JavaScript脚本,该脚本用于检测当前页面是否为特定域名下的index.html,并将其重定向到相应的目录下。若不符合条件,则输出错误提示。
97

被折叠的 条评论
为什么被折叠?



