网页特效-刷新,后退、前进、关闭、标题、跳转

1.刷新

  window.location.reload();

  或

  <meta http-equiv="refresh" content="20">  //20指每隔20S刷新一次页面

2.后退和前进

  window.history.forward(); //到之前网页

  window.history.back(); //到之后网页

  或:

  window.history.go(参数); //当参数为正数时表示前进N页,当为负数时则表示后退N页,go(-1)的效果与back()函数的效果一样。

3.关闭

  window.close();

4.标题

  document.title="标题";

5.跳转

  window.location.href="http://www.baidu.com";

  self.location.href="http://www.baidu.com";

posted @ 2016-09-20 14:19  承载梦想-韩旭明  阅读(400)  评论(0编辑  收藏  举报