如何从一个域网页重定向到另一个? [英] How to redirect webpage from one domain to another?
本文介绍了如何从一个域网页重定向到另一个?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何域名重定向到另一个域名,当第一个域(网页)的负载?
How to redirect domain to another domain, when the first domain (webpage) load?
推荐答案
有几个方法可以做到这一点。一是在onload事件添加到body标签什么套window.location的新领域。
There are a couple of ways to do this. One is to add the an onload event to the body tag what sets window.location to the new domain.
<script language=javascript>
function redirect(){
window.location = "http://example.com";
}
</script>
<body onload="redirect()">
</body>
这篇关于如何从一个域网页重定向到另一个?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文