Skip to content

Instantly share code, notes, and snippets.

@xgqfrms-GitHub
Created May 15, 2017 02:37
Show Gist options
  • Save xgqfrms-GitHub/1ba83e991eb358338151f54e5805ac5d to your computer and use it in GitHub Desktop.
Save xgqfrms-GitHub/1ba83e991eb358338151f54e5805ac5d to your computer and use it in GitHub Desktop.
html5-history-api

history 对象

http://javascript.ruanyifeng.com/bom/history.html

操纵浏览器的历史记录

https://developer.mozilla.org/zh-CN/docs/DOM/Manipulating_the_browser_history

window.history.back();

window.history.forward();

window.history.go(-1);

window.history.go(1);

window.history.length;

window.history.scrollRestoration;

window.history.state;
    window.history
    History {
        length: 14, 
        scrollRestoration: "auto", 
        state: 0
    }
    length: 14
    scrollRestoration: "auto"
    state: 0
    __proto__: History
        back: function back()
        forward: function forward()
        go: function go()
        length: (...)
        pushState: function pushState()
        replaceState: function replaceState()
        scrollRestoration: (...)
        state: (...)
        constructor: function History()
        Symbol(Symbol.toStringTag): "History"
        get length: function ()
        get scrollRestoration: function ()
        set scrollRestoration: function ()
        get state: function ()
        __proto__: Object

HTML5 简介(三):利用 History API 无刷新更改地址栏

https://www.renfei.org/blog/html5-introduction-3-history-api.html

HTML5之pushstate、popstate操作history,无刷新改变当前url

http://frontenddev.org/article/html-5-pushstate-popstate-operating-history-no-refresh-to-change-the-current-url.html

ajax与HTML5 history pushState/replaceState实例

http://www.zhangxinxu.com/wordpress/2013/06/html5-history-api-pushstate-replacestate-ajax/

再详解history.pushState和history.replaceState以及page ajax的实现

http://www.tangshuang.net/2287.html

Using the HTML5 History API

https://css-tricks.com/using-the-html5-history-api/

https://stackoverflow.com/questions/4570093/how-to-get-notified-about-changes-of-the-history-via-history-pushstate

https://stackoverflow.com/questions/17612307/pushstate-what-exactly-is-the-state-object-for

@xgqfrms-GitHub
Copy link
Author

xgqfrms-GitHub commented May 15, 2017

@xgqfrms-GitHub
Copy link
Author

xgqfrms-GitHub commented May 15, 2017

https://sites.google.com/a/chromium.org/dev/Home/chromium-security/deprecating-powerful-features-on-insecure-origins

chrome --unsafely-treat-insecure-origin-as-secure="http://i.cnblogs.com/h5monitor/final.html"  --user-data-dir=C:\testprofile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment