Permalink
Browse files

Fixed an issue in IE 6 where location.search and location.hash would …

…report incorrectly if the hash contained the ? character. Also $.param.querystring and $.param.fragment will no longer parse params out of a URL that doesn't contain ? or #, respectively.
  • Loading branch information...
1 parent 61d69fb commit 4a21af0834337a7fe201574e8d010037fd231065 @cowboy cowboy committed Dec 3, 2009
View
@@ -1,7 +1,7 @@
# jQuery BBQ: Back Button & Query Library #
[http://benalman.com/projects/jquery-bbq-plugin/](http://benalman.com/projects/jquery-bbq-plugin/)
-Version: 1.0.2, Last updated: 10/10/2009
+Version: 1.0.3, Last updated: 12/2/2009
jQuery BBQ enables simple, yet powerful bookmarkable #hash history via a cross-browser window.onhashchange event. In addition, jQuery BBQ provides a full jQuery.deparam() method, along with both fragment and query string parse and merge utility methods.
@@ -38,6 +38,7 @@ Internet Explorer 6-8, Firefox 2-3.6, Safari 3-4, Chrome, Opera 9.6-10.
## Release History ##
+1.0.3 - (12/2/2009) Fixed an issue in IE 6 where location.search and location.hash would report incorrectly if the hash contained the ? character. Also $.param.querystring and $.param.fragment will no longer parse params out of a URL that doesn't contain ? or #, respectively.
1.0.2 - (10/10/2009) Fixed an issue in IE 6/7 where the hidden IFRAME caused a "This page contains both secure and nonsecure items." warning when used on an https:// page.
1.0.1 - (10/7/2009) Fixed an issue in IE 8. Since both "IE7" and "IE8 Compatibility View" modes erroneously report that the browser supports the native window.onhashchange event, a slightly more robust test needed to be added.
1.0 - (10/2/2009) Initial release

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -13,7 +13,7 @@
<div id=Index><div class=IPageTitle>Event Index</div><div class=INavigationBar>$#! &middot; 0-9 &middot; A &middot; B &middot; C &middot; D &middot; E &middot; F &middot; G &middot; H &middot; I &middot; J &middot; K &middot; L &middot; M &middot; N &middot; <a href="#O">O</a> &middot; P &middot; Q &middot; R &middot; S &middot; T &middot; U &middot; V &middot; W &middot; X &middot; Y &middot; Z</div><table border=0 cellspacing=0 cellpadding=0><tr><td class=IHeading id=IFirstHeading><a name="O"></a>O</td><td></td></tr><tr><td class=ISymbolPrefix id=IOnlySymbolPrefix>&nbsp;</td><td class=IEntry><a href="../files/jquery-ba-bbq-js.html#window.onhashchange" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')" class=ISymbol>onhashchange</a>, <span class=IParent>window</span></td></tr></table>
<!--START_ND_TOOLTIPS-->
-<div class=CToolTip id="tt1"><div class=CEvent>Fired when document.location.hash changes. </div></div><!--END_ND_TOOLTIPS-->
+<div class=CToolTip id="tt1"><div class=CEvent>Fired when window.location.hash changes. </div></div><!--END_ND_TOOLTIPS-->
</div><!--Index-->
View
@@ -13,7 +13,7 @@
<div id=Index><div class=IPageTitle>File Index</div><div class=INavigationBar>$#! &middot; 0-9 &middot; A &middot; B &middot; C &middot; D &middot; E &middot; F &middot; G &middot; H &middot; I &middot; <a href="#J">J</a> &middot; K &middot; L &middot; M &middot; N &middot; O &middot; P &middot; Q &middot; R &middot; S &middot; T &middot; U &middot; V &middot; W &middot; X &middot; Y &middot; Z</div><table border=0 cellspacing=0 cellpadding=0><tr><td class=IHeading id=IFirstHeading><a name="J"></a>J</td><td></td></tr><tr><td class=ISymbolPrefix id=IOnlySymbolPrefix>&nbsp;</td><td class=IEntry><a href="../files/jquery-ba-bbq-js.html#jQuery_BBQ:Back_ButtonQuery_Library" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')" class=ISymbol>jQuery BBQ:<wbr>Back Button&amp;Query Library</a></td></tr></table>
<!--START_ND_TOOLTIPS-->
-<div class=CToolTip id="tt1"><div class=CFile><b>Version: 1.0.2, Last updated: 10/10/2009</b></div></div><!--END_ND_TOOLTIPS-->
+<div class=CToolTip id="tt1"><div class=CFile><b>Version: 1.0.2pre, Last updated: 12/2/2009</b></div></div><!--END_ND_TOOLTIPS-->
</div><!--Index-->
@@ -21,7 +21,7 @@
<!--START_ND_TOOLTIPS-->
-<div class=CToolTip id="tt3"><div class=CFunction>Parse the fragment (hash) from a URL or the current document.location, deserializing it into an object, optionally coercing numbers, booleans, null and undefined values.</div></div><div class=CToolTip id="tt4"><div class=CFunction>Update URL attribute in one or more elements, merging the current URL (with or without pre-existing fragment/hash params) plus any params object or string into a new URL, which is then set into that attribute. </div></div><div class=CToolTip id="tt5"><div class=CFunction>Retrieve the fragment (hash) from a URL or if no arguments are passed, the current document.location.</div></div><div class=CToolTip id="tt6"><div class=CFunction>Merge a URL, with or without pre-existing fragment (hash) params, plus any object, params string or URL containing fragment (hash) params into a new URL.</div></div><!--END_ND_TOOLTIPS-->
+<div class=CToolTip id="tt3"><div class=CFunction>Parse the fragment (hash) from a URL or the current window.location, deserializing it into an object, optionally coercing numbers, booleans, null and undefined values.</div></div><div class=CToolTip id="tt4"><div class=CFunction>Update URL attribute in one or more elements, merging the current URL (with or without pre-existing fragment/hash params) plus any params object or string into a new URL, which is then set into that attribute. </div></div><div class=CToolTip id="tt5"><div class=CFunction>Retrieve the fragment (hash) from a URL or if no arguments are passed, the current window.location.</div></div><div class=CToolTip id="tt6"><div class=CFunction>Merge a URL, with or without pre-existing fragment (hash) params, plus any object, params string or URL containing fragment (hash) params into a new URL.</div></div><!--END_ND_TOOLTIPS-->
<!--START_ND_TOOLTIPS-->
@@ -33,7 +33,7 @@
<!--START_ND_TOOLTIPS-->
-<div class=CToolTip id="tt9"><div class=CFunction>Parse the query string from a URL or the current document.location, deserializing it into an object, optionally coercing numbers, booleans, null and undefined values.</div></div><div class=CToolTip id="tt10"><div class=CFunction>Update URL attribute in one or more elements, merging the current URL (with or without pre-existing query string params) plus any params object or string into a new URL, which is then set into that attribute. </div></div><div class=CToolTip id="tt11"><div class=CFunction>Retrieve the query string from a URL or if no arguments are passed, the current document.location.</div></div><div class=CToolTip id="tt12"><div class=CFunction>Merge a URL, with or without pre-existing query string params, plus any object, params string or URL containing query string params into a new URL.</div></div><!--END_ND_TOOLTIPS-->
+<div class=CToolTip id="tt9"><div class=CFunction>Parse the query string from a URL or the current window.location, deserializing it into an object, optionally coercing numbers, booleans, null and undefined values.</div></div><div class=CToolTip id="tt10"><div class=CFunction>Update URL attribute in one or more elements, merging the current URL (with or without pre-existing query string params) plus any params object or string into a new URL, which is then set into that attribute. </div></div><div class=CToolTip id="tt11"><div class=CFunction>Retrieve the query string from a URL or if no arguments are passed, the current window.location.</div></div><div class=CToolTip id="tt12"><div class=CFunction>Merge a URL, with or without pre-existing query string params, plus any object, params string or URL containing query string params into a new URL.</div></div><!--END_ND_TOOLTIPS-->
</div><!--Index-->
View
@@ -21,7 +21,7 @@
<!--START_ND_TOOLTIPS-->
-<div class=CToolTip id="tt4"><div class=CFunction>Parse the fragment (hash) from a URL or the current document.location, deserializing it into an object, optionally coercing numbers, booleans, null and undefined values.</div></div><div class=CToolTip id="tt5"><div class=CFunction>Update URL attribute in one or more elements, merging the current URL (with or without pre-existing fragment/hash params) plus any params object or string into a new URL, which is then set into that attribute. </div></div><div class=CToolTip id="tt6"><div class=CFunction>Retrieve the fragment (hash) from a URL or if no arguments are passed, the current document.location.</div></div><div class=CToolTip id="tt7"><div class=CFunction>Merge a URL, with or without pre-existing fragment (hash) params, plus any object, params string or URL containing fragment (hash) params into a new URL.</div></div><!--END_ND_TOOLTIPS-->
+<div class=CToolTip id="tt4"><div class=CFunction>Parse the fragment (hash) from a URL or the current window.location, deserializing it into an object, optionally coercing numbers, booleans, null and undefined values.</div></div><div class=CToolTip id="tt5"><div class=CFunction>Update URL attribute in one or more elements, merging the current URL (with or without pre-existing fragment/hash params) plus any params object or string into a new URL, which is then set into that attribute. </div></div><div class=CToolTip id="tt6"><div class=CFunction>Retrieve the fragment (hash) from a URL or if no arguments are passed, the current window.location.</div></div><div class=CToolTip id="tt7"><div class=CFunction>Merge a URL, with or without pre-existing fragment (hash) params, plus any object, params string or URL containing fragment (hash) params into a new URL.</div></div><!--END_ND_TOOLTIPS-->
<!--START_ND_TOOLTIPS-->
@@ -33,23 +33,23 @@
<!--START_ND_TOOLTIPS-->
-<div class=CToolTip id="tt9"><div class=CFile><b>Version: 1.0.2, Last updated: 10/10/2009</b></div></div><!--END_ND_TOOLTIPS-->
+<div class=CToolTip id="tt9"><div class=CFile><b>Version: 1.0.2pre, Last updated: 12/2/2009</b></div></div><!--END_ND_TOOLTIPS-->
<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt10"><div class=CGeneric>Copyright &copy; 2009 &ldquo;Cowboy&rdquo; Ben Alman, Dual licensed under the MIT and GPL licenses. </div></div><!--END_ND_TOOLTIPS-->
<!--START_ND_TOOLTIPS-->
-<div class=CToolTip id="tt11"><div class=CEvent>Fired when document.location.hash changes. </div></div><!--END_ND_TOOLTIPS-->
+<div class=CToolTip id="tt11"><div class=CEvent>Fired when window.location.hash changes. </div></div><!--END_ND_TOOLTIPS-->
<!--START_ND_TOOLTIPS-->
<div class=CToolTip id="tt12"><div class=CProperty>The numeric interval (in milliseconds) at which the window.onhashchange polling loop executes. </div></div><div class=CToolTip id="tt13"><div class=CFunction>Adds a &lsquo;state&rsquo; into the browser history at the current position, setting location.hash and triggering any bound window.onhashchange event callbacks (provided the new state is different than the previous state).</div></div><!--END_ND_TOOLTIPS-->
<!--START_ND_TOOLTIPS-->
-<div class=CToolTip id="tt14"><div class=CFunction>Parse the query string from a URL or the current document.location, deserializing it into an object, optionally coercing numbers, booleans, null and undefined values.</div></div><div class=CToolTip id="tt15"><div class=CFunction>Update URL attribute in one or more elements, merging the current URL (with or without pre-existing query string params) plus any params object or string into a new URL, which is then set into that attribute. </div></div><div class=CToolTip id="tt16"><div class=CFunction>Retrieve the query string from a URL or if no arguments are passed, the current document.location.</div></div><div class=CToolTip id="tt17"><div class=CFunction>Merge a URL, with or without pre-existing query string params, plus any object, params string or URL containing query string params into a new URL.</div></div><!--END_ND_TOOLTIPS-->
+<div class=CToolTip id="tt14"><div class=CFunction>Parse the query string from a URL or the current window.location, deserializing it into an object, optionally coercing numbers, booleans, null and undefined values.</div></div><div class=CToolTip id="tt15"><div class=CFunction>Update URL attribute in one or more elements, merging the current URL (with or without pre-existing query string params) plus any params object or string into a new URL, which is then set into that attribute. </div></div><div class=CToolTip id="tt16"><div class=CFunction>Retrieve the query string from a URL or if no arguments are passed, the current window.location.</div></div><div class=CToolTip id="tt17"><div class=CFunction>Merge a URL, with or without pre-existing query string params, plus any object, params string or URL containing query string params into a new URL.</div></div><!--END_ND_TOOLTIPS-->
<!--START_ND_TOOLTIPS-->
Binary file not shown.
View
@@ -1,4 +1,4 @@
1.4
JavaScript
-/srv/projects/jquery-bbq/jquery.ba-bbq.min.js 1257879019 0 /srv/projects/jquery-bbq/jquery.ba-bbq.min.js
-/srv/projects/jquery-bbq/jquery.ba-bbq.js 1257879016 1 jQuery BBQ: Back Button & Query Library
+/srv/projects/jquery-bbq/jquery.ba-bbq.min.js 1259805776 0 /srv/projects/jquery-bbq/jquery.ba-bbq.min.js
+/srv/projects/jquery-bbq/jquery.ba-bbq.js 1259805774 1 jQuery BBQ: Back Button & Query Library
View
Binary file not shown.
@@ -31,11 +31,11 @@ function set_title( i ) {
document.title = document.title.replace( /\s*\d*$/, '' ) + ' ' + i;
}
-// Add new history entries by changing document.location.hash, in an
+// Add new history entries by changing window.location.hash, in an
// asynchronous loop.
function add_history_entries( start, end ) {
(function loopy(){
- document.location.hash = '#' + start;
+ window.location.hash = '#' + start;
set_title( start );
++start <= end && setTimeout( loopy, delay );
})();
@@ -51,7 +51,7 @@ function go_back( i ) {
// Some window.onhashchange stuff. Not really important here.
function handler() {
- var i = document.location.hash.replace( /^#/, '' );
+ var i = window.location.hash.replace( /^#/, '' );
set_title( i );
};
@@ -29,13 +29,13 @@
// Set the hash the "usual" way.
function callback_hash( idx ) {
debug.log( idx );
- document.location.hash = '#done_' + idx;
+ window.location.hash = '#done_' + idx;
};
// Set the hash by re-setting the entire URL.
function callback_href( idx ) {
debug.log( idx );
- document.location.href = document.location.href.replace( /#.*$/, '' ) + '#done_' + idx;
+ window.location.href = window.location.href.replace( /#.*$/, '' ) + '#done_' + idx;
};
// Set the hash by re-setting the entire URL.. asynchronously.
@@ -121,7 +121,7 @@ function callback_href_kluge( idx ) {
.appendTo( '#nav' )
.find( 'a' )
.click(function(){
- document.location.hash = '#start_' + idx;
+ window.location.hash = '#start_' + idx;
$.ajax( $.extend({}, v[1]) );
return false;
});
@@ -222,7 +222,7 @@
</p>
<p>
- In this example, document.location.hash is used to store a serialized data object representing the state of multiple "widgets". Due to the flexibility of $.bbq.pushState(), a widget doesn't need to know the state of any other widget to push a state change onto the history, only their state needs to be specifed and it will be merged in, creating a new history entry and a page state that is bookmarkable. Of course, if you only want to keep track of a single item on the page, you might want to check out the <a href="../fragment-basic/">basic window.onhashchange</a> example.
+ In this example, window.location.hash is used to store a serialized data object representing the state of multiple "widgets". Due to the flexibility of $.bbq.pushState(), a widget doesn't need to know the state of any other widget to push a state change onto the history, only their state needs to be specifed and it will be merged in, creating a new history entry and a page state that is bookmarkable. Of course, if you only want to keep track of a single item on the page, you might want to check out the <a href="../fragment-basic/">basic window.onhashchange</a> example.
</p>
@@ -185,7 +185,7 @@
</p>
<p>
- In this basic example, document.location.hash is used to store a simple string value of the file to be loaded via AJAX, so that not only a history entry is added, but also so that the page, in its current state, can be bookmarked. Because the hash contains only a single filename, this example doesn't support multiple content boxes, each with their own state, on the same page, but that's definitely still possible! Just check out the <a href="../fragment-advanced/">advanced window.onhashchange</a> example.
+ In this basic example, window.location.hash is used to store a simple string value of the file to be loaded via AJAX, so that not only a history entry is added, but also so that the page, in its current state, can be bookmarked. Because the hash contains only a single filename, this example doesn't support multiple content boxes, each with their own state, on the same page, but that's definitely still possible! Just check out the <a href="../fragment-advanced/">advanced window.onhashchange</a> example.
</p>
<h3>Navigation</h3>
@@ -147,7 +147,7 @@
</p>
<p>
- Like the <a href="../fragment-advanced/">advanced window.onhashchange</a> example, document.location.hash is used to store a serialized data object representing the state of multiple tab boxes. Due to the flexibility of $.bbq.pushState(), each tab box doesn't need to know the state of any other tab box to push a state change onto the history, only their state needs to be specifed and it will be merged in, creating a new history entry and a page state that is bookmarkable. Of course, if you only want to keep track of a single item on the page, you might want to check out the <a href="../fragment-basic/">basic window.onhashchange</a> example.
+ Like the <a href="../fragment-advanced/">advanced window.onhashchange</a> example, window.location.hash is used to store a serialized data object representing the state of multiple tab boxes. Due to the flexibility of $.bbq.pushState(), each tab box doesn't need to know the state of any other tab box to push a state change onto the history, only their state needs to be specifed and it will be merged in, creating a new history entry and a page state that is bookmarkable. Of course, if you only want to keep track of a single item on the page, you might want to check out the <a href="../fragment-basic/">basic window.onhashchange</a> example.
</p>
<h3>This jQuery UI Tabs widget has id "some_tabs"</h3>
Oops, something went wrong.

0 comments on commit 4a21af0

Please sign in to comment.