This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
The example includes an element like: <a href="?x=6" onclick="go(1)">Advance to 6</a> The onclick handler should include a "return false" so that we don't switch pages and instead use only use pushState().
As my understandings of the intention of pushState/popstate and the descriptions in the Mozilla site (https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history#State_information_for_history_entries), this line of code seems broken: function go(d) { history.pushState(currentPage, 'Line Game - ' + currentPage, '?x=' + currentPage); setupPage(currentPage + d); } It should be: function go(d) { setupPage(currentPage + d); history.pushState(currentPage, 'Line Game - ' + currentPage, '?x=' + currentPage); }
EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are satisfied with this response, please change the state of this bug to CLOSED. If you have additional information and would like the editor to reconsider, please reopen this bug. If you would like to escalate the issue to the full HTML Working Group, please add the TrackerRequest keyword to this bug, and suggest title and text for the tracker issue; or you may create a tracker issue yourself, if you are able to do so. For more details, see this document: http://dev.w3.org/html5/decision-policy/decision-policy.html Status: Partially Accepted Change Description: see diff given below Rationale: Fixed the issue in the original description. However, the issue in comment 1 is based on a misunderstanding of pushState() -- pushState() pushes the _previous_ state, not the current one.
Checked in as WHATWG revision r5351. Check-in comment: fix example http://html5.org/tools/web-apps-tracker?from=5350&to=5351
Er, nevermind. The misunderstanding was my own. Fixed comment 1, see diff below.
Checked in as WHATWG revision r5355. Check-in comment: fix pushState() example http://html5.org/tools/web-apps-tracker?from=5354&to=5355