Permalink
Browse files

Reworded the hashchange event (BBQ) section documentation to make thi…

…ngs a little clearer.
  • Loading branch information...
1 parent 76fa0fc commit d9ac4d96206acaeeb50ff305dacd5a6c188ff1ea @cowboy cowboy committed Feb 17, 2010
View
18 docs/files/jquery-ba-bbq-js.html
@@ -11,7 +11,7 @@
-<div id=Content><div class="CFile"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="jQuery_BBQ:Back_ButtonQuery_Library"></a>jQuery BBQ: Back Button &amp; Query Library</h1><div class=CBody><p><b>Version: 1.2.1, Last updated: 2/17/2010</b></p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>Project Home</td><td class=CDLDescription><a href="http://benalman.com/projects/jquery-bbq-plugin/" class=LURL target=_top>http://benalman.com/projects/jquery-bbq-plugin/</a></td></tr><tr><td class=CDLEntry>GitHub</td><td class=CDLDescription><a href="http://github.com/cowboy/jquery-bbq/" class=LURL target=_top>http://github.com/cowboy/jquery-bbq/</a></td></tr><tr><td class=CDLEntry>Source</td><td class=CDLDescription><a href="http://github.com/cowboy/jquery-bbq/raw/master/jquery.ba-bbq.js" class=LURL target=_top>http://github.com<wbr>/cowboy<wbr>/jquery-bbq<wbr>/raw<wbr>/master<wbr>/jquery.ba-bbq.js</a></td></tr><tr><td class=CDLEntry>(Minified)</td><td class=CDLDescription><a href="http://github.com/cowboy/jquery-bbq/raw/master/jquery.ba-bbq.min.js" class=LURL target=_top>http://github.com<wbr>/cowboy<wbr>/jquery-bbq<wbr>/raw<wbr>/master<wbr>/jquery.ba-bbq.min.js</a> (4.0kb)</td></tr></table><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#jQuery_BBQ:Back_ButtonQuery_Library" >jQuery BBQ: Back Button &amp; Query Library</a></td><td class=SDescription><b>Version: 1.2.1, Last updated: 2/17/2010</b></td></tr><tr class="SGeneric SMarked"><td class=SEntry><a href="#License" >License</a></td><td class=SDescription>Copyright &copy; 2010 &ldquo;Cowboy&rdquo; Ben Alman, Dual licensed under the MIT and GPL licenses. </td></tr><tr class="SGeneric"><td class=SEntry><a href="#Examples" >Examples</a></td><td class=SDescription>These working examples, complete with fully commented code, illustrate a few ways in which this plugin can be used.</td></tr><tr class="SGeneric SMarked"><td class=SEntry><a href="#Support_and_Testing" >Support and Testing</a></td><td class=SDescription>Information about what version or versions of jQuery this plugin has been tested with, what browsers it has been tested in, and where the unit tests reside (so you can test it yourself).</td></tr><tr class="SGeneric"><td class=SEntry><a href="#Release_History" >Release History</a></td><td class=SDescription></td></tr><tr class="SSection"><td class=SEntry><a href="#Param(to_string)" >Param (to string)</a></td><td class=SDescription></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jQuery.param.querystring" >jQuery.<wbr>param.<wbr>querystring</a></td><td class=SDescription>Retrieve the query string from a URL or if no arguments are passed, the current window.location.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jQuery.param.querystring(build_url)" >jQuery.<wbr>param.<wbr>querystring (build url)</a></td><td class=SDescription>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.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jQuery.param.fragment" >jQuery.<wbr>param.<wbr>fragment</a></td><td class=SDescription>Retrieve the fragment (hash) from a URL or if no arguments are passed, the current window.location.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jQuery.param.fragment(build_url)" >jQuery.<wbr>param.<wbr>fragment (build url)</a></td><td class=SDescription>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.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jQuery.param.fragment.noEscape" >jQuery.<wbr>param.<wbr>fragment.<wbr>noEscape</a></td><td class=SDescription>Specify characters that will be left unescaped when fragments are created or merged using <a href="#jQuery.param.fragment" class=LFunction id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">jQuery.param.fragment</a>, or when the fragment is modified using <a href="#jQuery.bbq.pushState" class=LFunction id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">jQuery.bbq.pushState</a>. </td></tr><tr class="SSection"><td class=SEntry><a href="#Deparam(from_string)" >Deparam (from string)</a></td><td class=SDescription></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jQuery.deparam" >jQuery.<wbr>deparam</a></td><td class=SDescription>Deserialize a params string into an object, optionally coercing numbers, booleans, null and undefined values; this method is the counterpart to the internal jQuery.param method.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jQuery.deparam.querystring" >jQuery.<wbr>deparam.<wbr>querystring</a></td><td class=SDescription>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.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jQuery.deparam.fragment" >jQuery.<wbr>deparam.<wbr>fragment</a></td><td class=SDescription>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.</td></tr><tr class="SSection"><td class=SEntry><a href="#Element_manipulation" >Element manipulation</a></td><td class=SDescription></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jQuery.elemUrlAttr" >jQuery.<wbr>elemUrlAttr</a></td><td class=SDescription>Get the internal &ldquo;Default URL attribute per tag&rdquo; list, or augment the list with additional tag-attribute pairs, in case the defaults are insufficient.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jQuery.fn.querystring" >jQuery.<wbr>fn.<wbr>querystring</a></td><td class=SDescription>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. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jQuery.fn.fragment" >jQuery.<wbr>fn.<wbr>fragment</a></td><td class=SDescription>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. </td></tr><tr class="SSection"><td class=SEntry><a href="#History,hashchange_event" >History, hashchange event</a></td><td class=SDescription></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jQuery.bbq.pushState" >jQuery.<wbr>bbq.<wbr>pushState</a></td><td class=SDescription>Adds a &lsquo;state&rsquo; into the browser history at the current position, setting location.hash and triggering any bound <a href="#hashchange_event" class=LEvent id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">hashchange event</a> callbacks (provided the new state is different than the previous state).</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jQuery.bbq.getState" >jQuery.<wbr>bbq.<wbr>getState</a></td><td class=SDescription>Retrieves the current &lsquo;state&rsquo; from the browser history, parsing location.hash for a specific key or returning an object containing the entire state, optionally coercing numbers, booleans, null and undefined values.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jQuery.bbq.removeState" >jQuery.<wbr>bbq.<wbr>removeState</a></td><td class=SDescription>Remove one or more keys from the current browser history &lsquo;state&rsquo;, creating a new state, setting location.hash and triggering any bound <a href="#hashchange_event" class=LEvent id=link4 onMouseOver="ShowTip(event, 'tt3', 'link4')" onMouseOut="HideTip('tt3')">hashchange event</a> callbacks (provided the new state is different than the previous state).</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Events" >Events</a></td><td class=SDescription></td></tr><tr class="SEvent SIndent2 SMarked"><td class=SEntry><a href="#hashchange_event(BBQ)" >hashchange event (BBQ)</a></td><td class=SDescription>In 1.4 and newer, the event object that is passed into the callback is augmented with an additional e.fragment property that contains the current document location.hash state as a string, as well as an e.getState method.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Files" >Files</a></td><td class=SDescription></td></tr><tr class="SFile SIndent2 SMarked"><td class=SEntry><a href="#jQuery_hashchange_event" >jQuery hashchange event</a></td><td class=SDescription><b>Version: 1.2, Last updated: 2/11/2010</b></td></tr><tr class="SGeneric SIndent2"><td class=SEntry><a href="#License" >License</a></td><td class=SDescription>Copyright &copy; 2010 &ldquo;Cowboy&rdquo; Ben Alman, Dual licensed under the MIT and GPL licenses. </td></tr><tr class="SGeneric SIndent2 SMarked"><td class=SEntry><a href="#Examples" >Examples</a></td><td class=SDescription>This working example, complete with fully commented code, illustrate one way in which this plugin can be used.</td></tr><tr class="SGeneric SIndent2"><td class=SEntry><a href="#Support_and_Testing" >Support and Testing</a></td><td class=SDescription>Information about what version or versions of jQuery this plugin has been tested with, what browsers it has been tested in, and where the unit tests reside (so you can test it yourself).</td></tr><tr class="SGeneric SIndent2 SMarked"><td class=SEntry><a href="#Known_issues" >Known issues</a></td><td class=SDescription>While this jQuery hashchange event implementation is quite stable and robust, there are a few unfortunate browser bugs surrounding expected hashchange event-based behaviors, independent of any JavaScript window.onhashchange abstraction. </td></tr><tr class="SGeneric SIndent2"><td class=SEntry><a href="#Release_History" >Release History</a></td><td class=SDescription></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Properties" >Properties</a></td><td class=SDescription></td></tr><tr class="SProperty SIndent2 SMarked"><td class=SEntry><a href="#jQuery.hashchangeDelay" >jQuery.<wbr>hashchangeDelay</a></td><td class=SDescription>The numeric interval (in milliseconds) at which the <a href="#hashchange_event" class=LEvent id=link5 onMouseOver="ShowTip(event, 'tt3', 'link5')" onMouseOut="HideTip('tt3')">hashchange event</a> polling loop executes. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Events" >Events</a></td><td class=SDescription></td></tr><tr class="SEvent SIndent2 SMarked"><td class=SEntry><a href="#hashchange_event" >hashchange event</a></td><td class=SDescription>Fired when location.hash changes. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
+<div id=Content><div class="CFile"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="jQuery_BBQ:Back_ButtonQuery_Library"></a>jQuery BBQ: Back Button &amp; Query Library</h1><div class=CBody><p><b>Version: 1.2.1, Last updated: 2/17/2010</b></p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>Project Home</td><td class=CDLDescription><a href="http://benalman.com/projects/jquery-bbq-plugin/" class=LURL target=_top>http://benalman.com/projects/jquery-bbq-plugin/</a></td></tr><tr><td class=CDLEntry>GitHub</td><td class=CDLDescription><a href="http://github.com/cowboy/jquery-bbq/" class=LURL target=_top>http://github.com/cowboy/jquery-bbq/</a></td></tr><tr><td class=CDLEntry>Source</td><td class=CDLDescription><a href="http://github.com/cowboy/jquery-bbq/raw/master/jquery.ba-bbq.js" class=LURL target=_top>http://github.com<wbr>/cowboy<wbr>/jquery-bbq<wbr>/raw<wbr>/master<wbr>/jquery.ba-bbq.js</a></td></tr><tr><td class=CDLEntry>(Minified)</td><td class=CDLDescription><a href="http://github.com/cowboy/jquery-bbq/raw/master/jquery.ba-bbq.min.js" class=LURL target=_top>http://github.com<wbr>/cowboy<wbr>/jquery-bbq<wbr>/raw<wbr>/master<wbr>/jquery.ba-bbq.min.js</a> (4.0kb)</td></tr></table><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#jQuery_BBQ:Back_ButtonQuery_Library" >jQuery BBQ: Back Button &amp; Query Library</a></td><td class=SDescription><b>Version: 1.2.1, Last updated: 2/17/2010</b></td></tr><tr class="SGeneric SMarked"><td class=SEntry><a href="#License" >License</a></td><td class=SDescription>Copyright &copy; 2010 &ldquo;Cowboy&rdquo; Ben Alman, Dual licensed under the MIT and GPL licenses. </td></tr><tr class="SGeneric"><td class=SEntry><a href="#Examples" >Examples</a></td><td class=SDescription>These working examples, complete with fully commented code, illustrate a few ways in which this plugin can be used.</td></tr><tr class="SGeneric SMarked"><td class=SEntry><a href="#Support_and_Testing" >Support and Testing</a></td><td class=SDescription>Information about what version or versions of jQuery this plugin has been tested with, what browsers it has been tested in, and where the unit tests reside (so you can test it yourself).</td></tr><tr class="SGeneric"><td class=SEntry><a href="#Release_History" >Release History</a></td><td class=SDescription></td></tr><tr class="SSection"><td class=SEntry><a href="#Param(to_string)" >Param (to string)</a></td><td class=SDescription></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jQuery.param.querystring" >jQuery.<wbr>param.<wbr>querystring</a></td><td class=SDescription>Retrieve the query string from a URL or if no arguments are passed, the current window.location.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jQuery.param.querystring(build_url)" >jQuery.<wbr>param.<wbr>querystring (build url)</a></td><td class=SDescription>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.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jQuery.param.fragment" >jQuery.<wbr>param.<wbr>fragment</a></td><td class=SDescription>Retrieve the fragment (hash) from a URL or if no arguments are passed, the current window.location.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jQuery.param.fragment(build_url)" >jQuery.<wbr>param.<wbr>fragment (build url)</a></td><td class=SDescription>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.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jQuery.param.fragment.noEscape" >jQuery.<wbr>param.<wbr>fragment.<wbr>noEscape</a></td><td class=SDescription>Specify characters that will be left unescaped when fragments are created or merged using <a href="#jQuery.param.fragment" class=LFunction id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">jQuery.param.fragment</a>, or when the fragment is modified using <a href="#jQuery.bbq.pushState" class=LFunction id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">jQuery.bbq.pushState</a>. </td></tr><tr class="SSection"><td class=SEntry><a href="#Deparam(from_string)" >Deparam (from string)</a></td><td class=SDescription></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jQuery.deparam" >jQuery.<wbr>deparam</a></td><td class=SDescription>Deserialize a params string into an object, optionally coercing numbers, booleans, null and undefined values; this method is the counterpart to the internal jQuery.param method.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jQuery.deparam.querystring" >jQuery.<wbr>deparam.<wbr>querystring</a></td><td class=SDescription>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.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jQuery.deparam.fragment" >jQuery.<wbr>deparam.<wbr>fragment</a></td><td class=SDescription>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.</td></tr><tr class="SSection"><td class=SEntry><a href="#Element_manipulation" >Element manipulation</a></td><td class=SDescription></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jQuery.elemUrlAttr" >jQuery.<wbr>elemUrlAttr</a></td><td class=SDescription>Get the internal &ldquo;Default URL attribute per tag&rdquo; list, or augment the list with additional tag-attribute pairs, in case the defaults are insufficient.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jQuery.fn.querystring" >jQuery.<wbr>fn.<wbr>querystring</a></td><td class=SDescription>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. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jQuery.fn.fragment" >jQuery.<wbr>fn.<wbr>fragment</a></td><td class=SDescription>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. </td></tr><tr class="SSection"><td class=SEntry><a href="#History,hashchange_event" >History, hashchange event</a></td><td class=SDescription></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jQuery.bbq.pushState" >jQuery.<wbr>bbq.<wbr>pushState</a></td><td class=SDescription>Adds a &lsquo;state&rsquo; into the browser history at the current position, setting location.hash and triggering any bound <a href="#hashchange_event" class=LEvent id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">hashchange event</a> callbacks (provided the new state is different than the previous state).</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#jQuery.bbq.getState" >jQuery.<wbr>bbq.<wbr>getState</a></td><td class=SDescription>Retrieves the current &lsquo;state&rsquo; from the browser history, parsing location.hash for a specific key or returning an object containing the entire state, optionally coercing numbers, booleans, null and undefined values.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jQuery.bbq.removeState" >jQuery.<wbr>bbq.<wbr>removeState</a></td><td class=SDescription>Remove one or more keys from the current browser history &lsquo;state&rsquo;, creating a new state, setting location.hash and triggering any bound <a href="#hashchange_event" class=LEvent id=link4 onMouseOver="ShowTip(event, 'tt3', 'link4')" onMouseOut="HideTip('tt3')">hashchange event</a> callbacks (provided the new state is different than the previous state).</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Events" >Events</a></td><td class=SDescription></td></tr><tr class="SEvent SIndent2 SMarked"><td class=SEntry><a href="#hashchange_event(BBQ)" >hashchange event (BBQ)</a></td><td class=SDescription>In jQuery 1.4 and newer, the event object passed into any hashchange event callback is augmented with a copy of the location.hash fragment at the time the event was triggered as its event.fragment property. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Files" >Files</a></td><td class=SDescription></td></tr><tr class="SFile SIndent2 SMarked"><td class=SEntry><a href="#jQuery_hashchange_event" >jQuery hashchange event</a></td><td class=SDescription><b>Version: 1.2, Last updated: 2/11/2010</b></td></tr><tr class="SGeneric SIndent2"><td class=SEntry><a href="#License" >License</a></td><td class=SDescription>Copyright &copy; 2010 &ldquo;Cowboy&rdquo; Ben Alman, Dual licensed under the MIT and GPL licenses. </td></tr><tr class="SGeneric SIndent2 SMarked"><td class=SEntry><a href="#Examples" >Examples</a></td><td class=SDescription>This working example, complete with fully commented code, illustrate one way in which this plugin can be used.</td></tr><tr class="SGeneric SIndent2"><td class=SEntry><a href="#Support_and_Testing" >Support and Testing</a></td><td class=SDescription>Information about what version or versions of jQuery this plugin has been tested with, what browsers it has been tested in, and where the unit tests reside (so you can test it yourself).</td></tr><tr class="SGeneric SIndent2 SMarked"><td class=SEntry><a href="#Known_issues" >Known issues</a></td><td class=SDescription>While this jQuery hashchange event implementation is quite stable and robust, there are a few unfortunate browser bugs surrounding expected hashchange event-based behaviors, independent of any JavaScript window.onhashchange abstraction. </td></tr><tr class="SGeneric SIndent2"><td class=SEntry><a href="#Release_History" >Release History</a></td><td class=SDescription></td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Properties" >Properties</a></td><td class=SDescription></td></tr><tr class="SProperty SIndent2 SMarked"><td class=SEntry><a href="#jQuery.hashchangeDelay" >jQuery.<wbr>hashchangeDelay</a></td><td class=SDescription>The numeric interval (in milliseconds) at which the <a href="#hashchange_event" class=LEvent id=link5 onMouseOver="ShowTip(event, 'tt3', 'link5')" onMouseOut="HideTip('tt3')">hashchange event</a> polling loop executes. </td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#Events" >Events</a></td><td class=SDescription></td></tr><tr class="SEvent SIndent2 SMarked"><td class=SEntry><a href="#hashchange_event" >hashchange event</a></td><td class=SDescription>Fired when location.hash changes. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="License"></a>License</h3><div class=CBody><p>Copyright &copy; 2010 &ldquo;Cowboy&rdquo; Ben Alman, Dual licensed under the MIT and GPL licenses.&nbsp; <a href="http://benalman.com/about/license/" class=LURL target=_top>http://benalman.com/about/license/</a></p></div></div></div>
@@ -55,7 +55,7 @@
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jQuery.fn.fragment"></a>jQuery.<wbr>fn.<wbr>fragment</h3><div class=CBody><p>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.&nbsp; Like <a href="#jQuery.param.fragment(build_url)" class=LFunction id=link25 onMouseOver="ShowTip(event, 'tt14', 'link25')" onMouseOut="HideTip('tt14')">jQuery.param.fragment (build url)</a>, but for all elements in a jQuery collection.</p><h4 class=CHeading>Usage</h4><blockquote><pre>jQuery('selector').fragment( [ attr, ] params [, merge_mode ] );</pre></blockquote><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>attr</td><td class=CDLDescription>(String) Optional name of an attribute that will contain a URL to merge params into.&nbsp; See <a href="#jQuery.elemUrlAttr" class=LFunction id=link26 onMouseOver="ShowTip(event, 'tt13', 'link26')" onMouseOut="HideTip('tt13')">jQuery.elemUrlAttr</a> for a list of default attributes.</td></tr><tr><td class=CDLEntry>params</td><td class=CDLDescription>(Object) A params object to be merged into the URL attribute.</td></tr><tr><td class=CDLEntry>params</td><td class=CDLDescription>(String) A URL containing fragment (hash) params, or params string to be merged into the URL attribute.</td></tr><tr><td class=CDLEntry>merge_mode</td><td class=CDLDescription>(Number) Merge behavior defaults to 0 if merge_mode is not specified, and is as-follows:</td></tr></table><ul><li>0: params in the params argument will override any params in attr URL.</li><li>1: any params in attr URL will override params in the params argument.</li><li>2: params argument will completely replace any fragment (hash) in attr URL.</li></ul><h4 class=CHeading>Returns</h4><p>(jQuery) The initial jQuery collection of elements, but with modified URL attribute values.</p></div></div></div>
-<div class="CSection"><div class=CTopic><h2 class=CTitle><a name="History,hashchange_event"></a>History, hashchange event</h2><div class=CBody><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SGroup"><td class=SEntry><a href="#Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#jQuery.bbq.pushState" >jQuery.<wbr>bbq.<wbr>pushState</a></td><td class=SDescription>Adds a &lsquo;state&rsquo; into the browser history at the current position, setting location.hash and triggering any bound <a href="#hashchange_event" class=LEvent id=link27 onMouseOver="ShowTip(event, 'tt3', 'link27')" onMouseOut="HideTip('tt3')">hashchange event</a> callbacks (provided the new state is different than the previous state).</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#jQuery.bbq.getState" >jQuery.<wbr>bbq.<wbr>getState</a></td><td class=SDescription>Retrieves the current &lsquo;state&rsquo; from the browser history, parsing location.hash for a specific key or returning an object containing the entire state, optionally coercing numbers, booleans, null and undefined values.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#jQuery.bbq.removeState" >jQuery.<wbr>bbq.<wbr>removeState</a></td><td class=SDescription>Remove one or more keys from the current browser history &lsquo;state&rsquo;, creating a new state, setting location.hash and triggering any bound <a href="#hashchange_event" class=LEvent id=link28 onMouseOver="ShowTip(event, 'tt3', 'link28')" onMouseOut="HideTip('tt3')">hashchange event</a> callbacks (provided the new state is different than the previous state).</td></tr><tr class="SGroup"><td class=SEntry><a href="#Events" >Events</a></td><td class=SDescription></td></tr><tr class="SEvent SIndent1 SMarked"><td class=SEntry><a href="#hashchange_event(BBQ)" >hashchange event (BBQ)</a></td><td class=SDescription>In 1.4 and newer, the event object that is passed into the callback is augmented with an additional e.fragment property that contains the current document location.hash state as a string, as well as an e.getState method.</td></tr><tr class="SGroup"><td class=SEntry><a href="#Files" >Files</a></td><td class=SDescription></td></tr><tr class="SFile SIndent1 SMarked"><td class=SEntry><a href="#jQuery_hashchange_event" >jQuery hashchange event</a></td><td class=SDescription><b>Version: 1.2, Last updated: 2/11/2010</b></td></tr><tr class="SGeneric SIndent1"><td class=SEntry><a href="#License" >License</a></td><td class=SDescription>Copyright &copy; 2010 &ldquo;Cowboy&rdquo; Ben Alman, Dual licensed under the MIT and GPL licenses. </td></tr><tr class="SGeneric SIndent1 SMarked"><td class=SEntry><a href="#Examples" >Examples</a></td><td class=SDescription>This working example, complete with fully commented code, illustrate one way in which this plugin can be used.</td></tr><tr class="SGeneric SIndent1"><td class=SEntry><a href="#Support_and_Testing" >Support and Testing</a></td><td class=SDescription>Information about what version or versions of jQuery this plugin has been tested with, what browsers it has been tested in, and where the unit tests reside (so you can test it yourself).</td></tr><tr class="SGeneric SIndent1 SMarked"><td class=SEntry><a href="#Known_issues" >Known issues</a></td><td class=SDescription>While this jQuery hashchange event implementation is quite stable and robust, there are a few unfortunate browser bugs surrounding expected hashchange event-based behaviors, independent of any JavaScript window.onhashchange abstraction. </td></tr><tr class="SGeneric SIndent1"><td class=SEntry><a href="#Release_History" >Release History</a></td><td class=SDescription></td></tr><tr class="SGroup"><td class=SEntry><a href="#Properties" >Properties</a></td><td class=SDescription></td></tr><tr class="SProperty SIndent1 SMarked"><td class=SEntry><a href="#jQuery.hashchangeDelay" >jQuery.<wbr>hashchangeDelay</a></td><td class=SDescription>The numeric interval (in milliseconds) at which the <a href="#hashchange_event" class=LEvent id=link29 onMouseOver="ShowTip(event, 'tt3', 'link29')" onMouseOut="HideTip('tt3')">hashchange event</a> polling loop executes. </td></tr><tr class="SGroup"><td class=SEntry><a href="#Events" >Events</a></td><td class=SDescription></td></tr><tr class="SEvent SIndent1 SMarked"><td class=SEntry><a href="#hashchange_event" >hashchange event</a></td><td class=SDescription>Fired when location.hash changes. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
+<div class="CSection"><div class=CTopic><h2 class=CTitle><a name="History,hashchange_event"></a>History, hashchange event</h2><div class=CBody><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SGroup"><td class=SEntry><a href="#Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#jQuery.bbq.pushState" >jQuery.<wbr>bbq.<wbr>pushState</a></td><td class=SDescription>Adds a &lsquo;state&rsquo; into the browser history at the current position, setting location.hash and triggering any bound <a href="#hashchange_event" class=LEvent id=link27 onMouseOver="ShowTip(event, 'tt3', 'link27')" onMouseOut="HideTip('tt3')">hashchange event</a> callbacks (provided the new state is different than the previous state).</td></tr><tr class="SFunction SIndent1"><td class=SEntry><a href="#jQuery.bbq.getState" >jQuery.<wbr>bbq.<wbr>getState</a></td><td class=SDescription>Retrieves the current &lsquo;state&rsquo; from the browser history, parsing location.hash for a specific key or returning an object containing the entire state, optionally coercing numbers, booleans, null and undefined values.</td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#jQuery.bbq.removeState" >jQuery.<wbr>bbq.<wbr>removeState</a></td><td class=SDescription>Remove one or more keys from the current browser history &lsquo;state&rsquo;, creating a new state, setting location.hash and triggering any bound <a href="#hashchange_event" class=LEvent id=link28 onMouseOver="ShowTip(event, 'tt3', 'link28')" onMouseOut="HideTip('tt3')">hashchange event</a> callbacks (provided the new state is different than the previous state).</td></tr><tr class="SGroup"><td class=SEntry><a href="#Events" >Events</a></td><td class=SDescription></td></tr><tr class="SEvent SIndent1 SMarked"><td class=SEntry><a href="#hashchange_event(BBQ)" >hashchange event (BBQ)</a></td><td class=SDescription>In jQuery 1.4 and newer, the event object passed into any hashchange event callback is augmented with a copy of the location.hash fragment at the time the event was triggered as its event.fragment property. </td></tr><tr class="SGroup"><td class=SEntry><a href="#Files" >Files</a></td><td class=SDescription></td></tr><tr class="SFile SIndent1 SMarked"><td class=SEntry><a href="#jQuery_hashchange_event" >jQuery hashchange event</a></td><td class=SDescription><b>Version: 1.2, Last updated: 2/11/2010</b></td></tr><tr class="SGeneric SIndent1"><td class=SEntry><a href="#License" >License</a></td><td class=SDescription>Copyright &copy; 2010 &ldquo;Cowboy&rdquo; Ben Alman, Dual licensed under the MIT and GPL licenses. </td></tr><tr class="SGeneric SIndent1 SMarked"><td class=SEntry><a href="#Examples" >Examples</a></td><td class=SDescription>This working example, complete with fully commented code, illustrate one way in which this plugin can be used.</td></tr><tr class="SGeneric SIndent1"><td class=SEntry><a href="#Support_and_Testing" >Support and Testing</a></td><td class=SDescription>Information about what version or versions of jQuery this plugin has been tested with, what browsers it has been tested in, and where the unit tests reside (so you can test it yourself).</td></tr><tr class="SGeneric SIndent1 SMarked"><td class=SEntry><a href="#Known_issues" >Known issues</a></td><td class=SDescription>While this jQuery hashchange event implementation is quite stable and robust, there are a few unfortunate browser bugs surrounding expected hashchange event-based behaviors, independent of any JavaScript window.onhashchange abstraction. </td></tr><tr class="SGeneric SIndent1"><td class=SEntry><a href="#Release_History" >Release History</a></td><td class=SDescription></td></tr><tr class="SGroup"><td class=SEntry><a href="#Properties" >Properties</a></td><td class=SDescription></td></tr><tr class="SProperty SIndent1 SMarked"><td class=SEntry><a href="#jQuery.hashchangeDelay" >jQuery.<wbr>hashchangeDelay</a></td><td class=SDescription>The numeric interval (in milliseconds) at which the <a href="#hashchange_event" class=LEvent id=link29 onMouseOver="ShowTip(event, 'tt3', 'link29')" onMouseOut="HideTip('tt3')">hashchange event</a> polling loop executes. </td></tr><tr class="SGroup"><td class=SEntry><a href="#Events" >Events</a></td><td class=SDescription></td></tr><tr class="SEvent SIndent1 SMarked"><td class=SEntry><a href="#hashchange_event" >hashchange event</a></td><td class=SDescription>Fired when location.hash changes. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Functions"></a>Functions</h3></div></div>
@@ -67,13 +67,13 @@
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Events"></a>Events</h3></div></div>
-<div class="CEvent"><div class=CTopic><h3 class=CTitle><a name="hashchange_event(BBQ)"></a>hashchange event (BBQ)</h3><div class=CBody><h4 class=CHeading>Usage in 1.4 and newer</h4><p>In 1.4 and newer, the event object that is passed into the callback is augmented with an additional e.fragment property that contains the current document location.hash state as a string, as well as an e.getState method.</p><p>e.fragment is equivalent to the output of <a href="#jQuery.param.fragment" class=LFunction id=link32 onMouseOver="ShowTip(event, 'tt1', 'link32')" onMouseOut="HideTip('tt1')">jQuery.param.fragment</a>, and e.getState() is equivalent to <a href="#jQuery.bbq.getState" class=LFunction id=link33 onMouseOver="ShowTip(event, 'tt15', 'link33')" onMouseOut="HideTip('tt15')">jQuery.bbq.getState</a>, except that they refer to the event-specific state value stored in the event object, instead of the current window.location, allowing the event object to be referenced later, even if window.location has changed.</p><blockquote><pre>$(window).bind( 'hashchange', function(e) {
- var hash_str = e.fragment,
- param_obj = e.getState(),
- param_val = e.getState( 'param_name' ),
- param_val_coerced = e.getState( 'param_name', true );
+<div class="CEvent"><div class=CTopic><h3 class=CTitle><a name="hashchange_event(BBQ)"></a>hashchange event (BBQ)</h3><div class=CBody><h4 class=CHeading>Usage in jQuery 1.4 and newer</h4><p>In jQuery 1.4 and newer, the event object passed into any hashchange event callback is augmented with a copy of the location.hash fragment at the time the event was triggered as its event.fragment property.&nbsp; In addition, the event.getState method operates on this property (instead of location.hash) which allows this fragment-as-a-state to be referenced later, even after window.location may have changed.</p><p>Note that event.fragment and event.getState are not defined according to W3C (or any other) specification, but will still be available whether or not the hashchange event exists natively in the browser, because of the utility they provide.</p><p>The event.fragment property contains the output of <a href="#jQuery.param.fragment" class=LFunction id=link32 onMouseOver="ShowTip(event, 'tt1', 'link32')" onMouseOut="HideTip('tt1')">jQuery.param.fragment</a> and the event.getState method is equivalent to the <a href="#jQuery.bbq.getState" class=LFunction id=link33 onMouseOver="ShowTip(event, 'tt15', 'link33')" onMouseOut="HideTip('tt15')">jQuery.bbq.getState</a> method.</p><blockquote><pre>$(window).bind( 'hashchange', function( event ) {
+ var hash_str = event.fragment,
+ param_obj = event.getState(),
+ param_val = event.getState( 'param_name' ),
+ param_val_coerced = event.getState( 'param_name', true );
...
-});</pre></blockquote><h4 class=CHeading>Usage in 1.3.2</h4><p>In 1.3.2, the event object is unable to be augmented as in 1.4+, so the fragment state isn&rsquo;t bound to the event object and must instead be parsed using the <a href="#jQuery.param.fragment" class=LFunction id=link34 onMouseOver="ShowTip(event, 'tt1', 'link34')" onMouseOut="HideTip('tt1')">jQuery.param.fragment</a> and <a href="#jQuery.bbq.getState" class=LFunction id=link35 onMouseOver="ShowTip(event, 'tt15', 'link35')" onMouseOut="HideTip('tt15')">jQuery.bbq.getState</a> methods.</p><blockquote><pre>$(window).bind( 'hashchange', function(e) {
+});</pre></blockquote><h4 class=CHeading>Usage in jQuery 1.3.2</h4><p>In jQuery 1.3.2, the event object cannot to be augmented as in jQuery 1.4+, so the fragment state isn&rsquo;t bound to the event object and must instead be parsed using the <a href="#jQuery.param.fragment" class=LFunction id=link34 onMouseOver="ShowTip(event, 'tt1', 'link34')" onMouseOut="HideTip('tt1')">jQuery.param.fragment</a> and <a href="#jQuery.bbq.getState" class=LFunction id=link35 onMouseOver="ShowTip(event, 'tt15', 'link35')" onMouseOut="HideTip('tt15')">jQuery.bbq.getState</a> methods.</p><blockquote><pre>$(window).bind( 'hashchange', function( event ) {
var hash_str = $.param.fragment(),
param_obj = $.bbq.getState(),
param_val = $.bbq.getState( 'param_name' ),
@@ -119,7 +119,7 @@
<!--START_ND_TOOLTIPS-->
-<div class=CToolTip id="tt1"><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="tt2"><div class=CFunction>Adds a &lsquo;state&rsquo; into the browser history at the current position, setting location.hash and triggering any bound hashchange event callbacks (provided the new state is different than the previous state).</div></div><div class=CToolTip id="tt3"><div class=CEvent>Fired when location.hash changes. </div></div><div class=CToolTip id="tt4"><div class=CFile><b>Version: 1.2, Last updated: 2/11/2010</b></div></div><div class=CToolTip id="tt5"><div class=CFunction>Specify characters that will be left unescaped when fragments are created or merged using jQuery.param.fragment, or when the fragment is modified using jQuery.bbq.pushState. </div></div><div class=CToolTip id="tt6"><div class=CEvent>In 1.4 and newer, the event object that is passed into the callback is augmented with an additional e.fragment property that contains the current document location.hash state as a string, as well as an e.getState method.</div></div><div class=CToolTip id="tt7"><div class=CFunction>Remove one or more keys from the current browser history &lsquo;state&rsquo;, creating a new state, setting location.hash and triggering any bound hashchange event callbacks (provided the new state is different than the previous state).</div></div><div class=CToolTip id="tt8"><div class=CFunction>Deserialize a params string into an object, optionally coercing numbers, booleans, null and undefined values; this method is the counterpart to the internal jQuery.param method.</div></div><div class=CToolTip id="tt9"><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="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>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="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><div class=CToolTip id="tt13"><div class=CFunction>Get the internal &ldquo;Default URL attribute per tag&rdquo; list, or augment the list with additional tag-attribute pairs, in case the defaults are insufficient.</div></div><div class=CToolTip id="tt14"><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><div class=CToolTip id="tt15"><div class=CFunction>Retrieves the current &lsquo;state&rsquo; from the browser history, parsing location.hash for a specific key or returning an object containing the entire state, optionally coercing numbers, booleans, null and undefined values.</div></div><div class=CToolTip id="tt16"><div class=CProperty>The numeric interval (in milliseconds) at which the hashchange event polling loop executes. </div></div><!--END_ND_TOOLTIPS-->
+<div class=CToolTip id="tt1"><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="tt2"><div class=CFunction>Adds a &lsquo;state&rsquo; into the browser history at the current position, setting location.hash and triggering any bound hashchange event callbacks (provided the new state is different than the previous state).</div></div><div class=CToolTip id="tt3"><div class=CEvent>Fired when location.hash changes. </div></div><div class=CToolTip id="tt4"><div class=CFile><b>Version: 1.2, Last updated: 2/11/2010</b></div></div><div class=CToolTip id="tt5"><div class=CFunction>Specify characters that will be left unescaped when fragments are created or merged using jQuery.param.fragment, or when the fragment is modified using jQuery.bbq.pushState. </div></div><div class=CToolTip id="tt6"><div class=CEvent>In jQuery 1.4 and newer, the event object passed into any hashchange event callback is augmented with a copy of the location.hash fragment at the time the event was triggered as its event.fragment property. </div></div><div class=CToolTip id="tt7"><div class=CFunction>Remove one or more keys from the current browser history &lsquo;state&rsquo;, creating a new state, setting location.hash and triggering any bound hashchange event callbacks (provided the new state is different than the previous state).</div></div><div class=CToolTip id="tt8"><div class=CFunction>Deserialize a params string into an object, optionally coercing numbers, booleans, null and undefined values; this method is the counterpart to the internal jQuery.param method.</div></div><div class=CToolTip id="tt9"><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="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>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="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><div class=CToolTip id="tt13"><div class=CFunction>Get the internal &ldquo;Default URL attribute per tag&rdquo; list, or augment the list with additional tag-attribute pairs, in case the defaults are insufficient.</div></div><div class=CToolTip id="tt14"><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><div class=CToolTip id="tt15"><div class=CFunction>Retrieves the current &lsquo;state&rsquo; from the browser history, parsing location.hash for a specific key or returning an object containing the entire state, optionally coercing numbers, booleans, null and undefined values.</div></div><div class=CToolTip id="tt16"><div class=CProperty>The numeric interval (in milliseconds) at which the hashchange event polling loop executes. </div></div><!--END_ND_TOOLTIPS-->
View
2 docs/index/Events.html
@@ -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; <a href="#H">H</a> &middot; I &middot; J &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="H"></a>H</td><td></td></tr><tr><td class=ISymbolPrefix id=IFirstSymbolPrefix>&nbsp;</td><td class=IEntry><a href="../files/jquery-ba-bbq-js.html#hashchange_event" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')" class=ISymbol>hashchange event</a></td></tr><tr><td class=ISymbolPrefix id=ILastSymbolPrefix>&nbsp;</td><td class=IEntry><a href="../files/jquery-ba-bbq-js.html#hashchange_event(BBQ)" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')" class=ISymbol>hashchange event(BBQ)</a></td></tr></table>
<!--START_ND_TOOLTIPS-->
-<div class=CToolTip id="tt1"><div class=CEvent>Fired when location.hash changes. </div></div><div class=CToolTip id="tt2"><div class=CEvent>In 1.4 and newer, the event object that is passed into the callback is augmented with an additional e.fragment property that contains the current document location.hash state as a string, as well as an e.getState method.</div></div><!--END_ND_TOOLTIPS-->
+<div class=CToolTip id="tt1"><div class=CEvent>Fired when location.hash changes. </div></div><div class=CToolTip id="tt2"><div class=CEvent>In jQuery 1.4 and newer, the event object passed into any hashchange event callback is augmented with a copy of the location.hash fragment at the time the event was triggered as its event.fragment property. </div></div><!--END_ND_TOOLTIPS-->
</div><!--Index-->
View
2 docs/index/General.html
@@ -29,7 +29,7 @@
<!--START_ND_TOOLTIPS-->
-<div class=CToolTip id="tt9"><div class=CEvent>Fired when location.hash changes. </div></div><div class=CToolTip id="tt10"><div class=CEvent>In 1.4 and newer, the event object that is passed into the callback is augmented with an additional e.fragment property that contains the current document location.hash state as a string, as well as an e.getState method.</div></div><div class=CToolTip id="tt11"><div class=CProperty>The numeric interval (in milliseconds) at which the hashchange event polling loop executes. </div></div><!--END_ND_TOOLTIPS-->
+<div class=CToolTip id="tt9"><div class=CEvent>Fired when location.hash changes. </div></div><div class=CToolTip id="tt10"><div class=CEvent>In jQuery 1.4 and newer, the event object passed into any hashchange event callback is augmented with a copy of the location.hash fragment at the time the event was triggered as its event.fragment property. </div></div><div class=CToolTip id="tt11"><div class=CProperty>The numeric interval (in milliseconds) at which the hashchange event polling loop executes. </div></div><!--END_ND_TOOLTIPS-->
<!--START_ND_TOOLTIPS-->
View
4 docs/nd/Data/FileInfo.nd
@@ -1,4 +1,4 @@
1.4
JavaScript
-/srv/projects/jquery-bbq/jquery.ba-bbq.min.js 1266411153 0 /srv/projects/jquery-bbq/jquery.ba-bbq.min.js
-/srv/projects/jquery-bbq/jquery.ba-bbq.js 1266411113 1 jQuery BBQ: Back Button & Query Library
+/srv/projects/jquery-bbq/jquery.ba-bbq.min.js 1266412333 0 /srv/projects/jquery-bbq/jquery.ba-bbq.min.js
+/srv/projects/jquery-bbq/jquery.ba-bbq.js 1266412265 1 jQuery BBQ: Back Button & Query Library
View
BIN docs/nd/Data/SymbolTable.nd
Binary file not shown.
View
50 jquery.ba-bbq.js
@@ -804,33 +804,39 @@
// Event: hashchange event (BBQ)
//
- // Usage in 1.4 and newer:
- //
- // In 1.4 and newer, the event object that is passed into the callback is
- // augmented with an additional e.fragment property that contains the current
- // document location.hash state as a string, as well as an e.getState method.
- //
- // e.fragment is equivalent to the output of <jQuery.param.fragment>, and
- // e.getState() is equivalent to <jQuery.bbq.getState>, except that they refer
- // to the event-specific state value stored in the event object, instead of
- // the current window.location, allowing the event object to be referenced
- // later, even if window.location has changed.
- //
- // > $(window).bind( 'hashchange', function(e) {
- // > var hash_str = e.fragment,
- // > param_obj = e.getState(),
- // > param_val = e.getState( 'param_name' ),
- // > param_val_coerced = e.getState( 'param_name', true );
+ // Usage in jQuery 1.4 and newer:
+ //
+ // In jQuery 1.4 and newer, the event object passed into any hashchange event
+ // callback is augmented with a copy of the location.hash fragment at the time
+ // the event was triggered as its event.fragment property. In addition, the
+ // event.getState method operates on this property (instead of location.hash)
+ // which allows this fragment-as-a-state to be referenced later, even after
+ // window.location may have changed.
+ //
+ // Note that event.fragment and event.getState are not defined according to
+ // W3C (or any other) specification, but will still be available whether or
+ // not the hashchange event exists natively in the browser, because of the
+ // utility they provide.
+ //
+ // The event.fragment property contains the output of <jQuery.param.fragment>
+ // and the event.getState method is equivalent to the <jQuery.bbq.getState>
+ // method.
+ //
+ // > $(window).bind( 'hashchange', function( event ) {
+ // > var hash_str = event.fragment,
+ // > param_obj = event.getState(),
+ // > param_val = event.getState( 'param_name' ),
+ // > param_val_coerced = event.getState( 'param_name', true );
// > ...
// > });
//
- // Usage in 1.3.2:
+ // Usage in jQuery 1.3.2:
//
- // In 1.3.2, the event object is unable to be augmented as in 1.4+, so the
- // fragment state isn't bound to the event object and must instead be parsed
- // using the <jQuery.param.fragment> and <jQuery.bbq.getState> methods.
+ // In jQuery 1.3.2, the event object cannot to be augmented as in jQuery 1.4+,
+ // so the fragment state isn't bound to the event object and must instead be
+ // parsed using the <jQuery.param.fragment> and <jQuery.bbq.getState> methods.
//
- // > $(window).bind( 'hashchange', function(e) {
+ // > $(window).bind( 'hashchange', function( event ) {
// > var hash_str = $.param.fragment(),
// > param_obj = $.bbq.getState(),
// > param_val = $.bbq.getState( 'param_name' ),

0 comments on commit d9ac4d9

Please sign in to comment.