我想将网页从我的网络日志重定向到我在其上的域名。例如,以下url:
the-vampire-diaries.mihanblog.com/post/300应重定向至此:
tvdfans.ir/post/300问题是我只能访问样式代码,而不能访问文件。我想要一个可以做到这一点的JavaScript代码。
发布于 2012-07-16 03:07:23
是的,您可以使用javascript来实现这一点
**Example:**
<script langauge="text/javascript">
window.location.replace(someUrl");
</script>发布于 2012-07-16 03:02:34
你不能在样式表中编写javascript代码。
如果您有权访问html模板,则只需使用
<script>
document.location.hostname = 'example.org';
</script>https://stackoverflow.com/questions/11494708
复制相似问题