Skip to content

Commit 99cb12b

Browse files
committed
Fixed html
Fixed typing
1 parent 1e86e3d commit 99cb12b

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

demo/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<!-- HTML -->
1717
<div id="wrap">
1818
<!-- Intro -->
19-
<h1>History.js</a></h1>
19+
<h1>History.js</h1>
2020
<p>History.js gracefully supports the <a href="https://developer.mozilla.org/en/DOM/Manipulating_the_browser_history">HTML5 History/State APIs</a> (pushState, replaceState, onPopState) in all browsers. Including continued support for data, titles, replaceState. Supports <a href="http://jquery.com/">jQuery</a>, <a href="http://mootools.net">MooTools</a> and <a href="http://prototypejs.org">Prototype</a>. For HTML5 browsers this means that you can modify the URL directly, without needing to use hashes anymore. For HTML4 browsers it will revert back to using the old onhashchange functionality.</p>
2121

2222
<!-- Textarea for Logging -->

scripts/uncompressed/history.html4.js

+7-10
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,7 @@
514514

515515
// Check the State
516516
if ( History.getHashByUrl(url) ) {
517-
throw new Error('History.js does not support states with fragement-identifiers (hashes/anchors).');
517+
throw new Error('History.js does not support states with fragment-identifiers (hashes/anchors).');
518518
}
519519

520520
// Handle Queueing
@@ -558,21 +558,18 @@
558558
return false;
559559
}
560560

561-
// Update HTML4 Hash
562-
if ( !History.isHashEqual(newStateHash, html4Hash) && !History.isHashEqual(newStateHash, History.getShortUrl(History.getLocationHref())) ) {
563-
//History.debug('History.pushState: update hash', newStateHash, html4Hash);
564-
History.setHash(newStateHash,false);
565-
History.busy(false);
566-
return false;
567-
}
568-
569561
// Update HTML5 State
570562
History.saveState(newState);
571563

572564
// Fire HTML5 Event
573-
//History.debug('History.pushState: trigger popstate');
574565
if(!wasExpected)
575566
History.Adapter.trigger(window,'statechange');
567+
568+
// Update HTML4 Hash
569+
if ( !History.isHashEqual(newStateHash, html4Hash) && !History.isHashEqual(newStateHash, History.getShortUrl(History.getLocationHref())) ) {
570+
History.setHash(newStateHash,false);
571+
}
572+
576573
History.busy(false);
577574

578575
// End pushState closure

0 commit comments

Comments
 (0)