Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 8e0064ba68
Fetching contributors…

Cannot retrieve contributors at this time

154 lines (86 sloc) 80.615 kb
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><title>jQuery BBQ: Back Button &amp; Query Library</title><link rel="stylesheet" type="text/css" href="../styles/main.css"><script language=JavaScript src="../javascript/main.js"></script><script language=JavaScript src="../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad()"><script language=JavaScript><!--
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>
<!-- Generated by Natural Docs, version 1.4 -->
<!-- http://www.naturaldocs.org -->
<!-- saved from url=(0026)http://www.naturaldocs.org -->
<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.3pre, Last updated: 8/26/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> (2.2kb gzipped)</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.3pre, Last updated: 8/26/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.href.</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.href.</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.sorted" >jQuery.<wbr>param.<wbr>sorted</a></td><td class=SDescription>Returns a params string equivalent to that returned by the internal jQuery.param method, but sorted, which makes it suitable for use as a cache key.</td></tr><tr class="SFunction SIndent2"><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="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jQuery.param.fragment.ajaxCrawlable" >jQuery.<wbr>param.<wbr>fragment.<wbr>ajaxCrawlable</a></td><td class=SDescription>TODO: DESCRIBE</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.href, 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.href, 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.3, Last updated: 7/21/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>These working examples, complete with fully commented code, illustrate a few ways 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="#Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#jQuery.fn.hashchange" >jQuery.<wbr>fn.<wbr>hashchange</a></td><td class=SDescription>Bind a handler to the window.onhashchange event or trigger all bound window.onhashchange event handlers. </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.fn.hashchange.delay" >jQuery.<wbr>fn.<wbr>hashchange.<wbr>delay</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="SProperty SIndent2"><td class=SEntry><a href="#jQuery.fn.hashchange.domain" >jQuery.<wbr>fn.<wbr>hashchange.<wbr>domain</a></td><td class=SDescription>If you&rsquo;re setting document.domain in your JavaScript, and you want hash history to work in IE6/7, not only must this property be set, but you must also set document.domain BEFORE jQuery is loaded into the page. </td></tr><tr class="SProperty SIndent2 SMarked"><td class=SEntry><a href="#jQuery.fn.hashchange.src" >jQuery.<wbr>fn.<wbr>hashchange.src</a></td><td class=SDescription>If, for some reason, you need to specify an Iframe src file (for example, when setting document.domain as in <a href="#jQuery.fn.hashchange.domain" class=LProperty id=link6 onMouseOver="ShowTip(event, 'tt4', 'link6')" onMouseOut="HideTip('tt4')">jQuery.fn.hashchange.domain</a>), you can do so using this property. </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>
<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="Examples"></a>Examples</h3><div class=CBody><p>These working examples, complete with fully commented code, illustrate a few ways in which this plugin can be used.</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>Basic AJAX</td><td class=CDLDescription><a href="http://benalman.com/code/projects/jquery-bbq/examples/fragment-basic/" class=LURL target=_top>http://benalman.com<wbr>/code<wbr>/projects<wbr>/jquery-bbq<wbr>/examples<wbr>/fragment-basic<wbr>/</a></td></tr><tr><td class=CDLEntry>Advanced AJAX</td><td class=CDLDescription><a href="http://benalman.com/code/projects/jquery-bbq/examples/fragment-advanced/" class=LURL target=_top>http://benalman.com<wbr>/code<wbr>/projects<wbr>/jquery-bbq<wbr>/examples<wbr>/fragment-advanced<wbr>/</a></td></tr><tr><td class=CDLEntry>jQuery UI Tabs</td><td class=CDLDescription><a href="http://benalman.com/code/projects/jquery-bbq/examples/fragment-jquery-ui-tabs/" class=LURL target=_top>http://benalman.com<wbr>/code<wbr>/projects<wbr>/jquery-bbq<wbr>/examples<wbr>/fragment-jquery-ui-tabs<wbr>/</a></td></tr><tr><td class=CDLEntry>Deparam</td><td class=CDLDescription><a href="http://benalman.com/code/projects/jquery-bbq/examples/deparam/" class=LURL target=_top>http://benalman.com<wbr>/code<wbr>/projects<wbr>/jquery-bbq<wbr>/examples<wbr>/deparam<wbr>/</a></td></tr></table></div></div></div>
<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="Support_and_Testing"></a>Support and Testing</h3><div class=CBody><p>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).</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>jQuery Versions</td><td class=CDLDescription>1.2.6, 1.3.2, 1.4.1, 1.4.2</td></tr><tr><td class=CDLEntry>Browsers Tested</td><td class=CDLDescription>Internet Explorer 6-8, Firefox 2-4, Chrome 5-6, Safari 3.2-5, Opera 9.6-10.60, iPhone 3.1, Android 1.6-2.2, BlackBerry 4.6-5.</td></tr><tr><td class=CDLEntry>Unit Tests</td><td class=CDLDescription><a href="http://benalman.com/code/projects/jquery-bbq/unit/" class=LURL target=_top>http://benalman.com<wbr>/code<wbr>/projects<wbr>/jquery-bbq<wbr>/unit<wbr>/</a></td></tr></table></div></div></div>
<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="Release_History"></a>Release History</h3><div class=CBody><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>1.3pre</td><td class=CDLDescription>(8/26/2010) Integrated <a href="#jQuery_hashchange_event" class=LFile id=link7 onMouseOver="ShowTip(event, 'tt5', 'link7')" onMouseOut="HideTip('tt5')">jQuery hashchange event</a> v1.3, which adds document.title and document.domain support in IE6/7, BlackBerry support, better Iframe hiding for accessibility reasons, and the new <a href="#jQuery.fn.hashchange" class=LFunction id=link8 onMouseOver="ShowTip(event, 'tt6', 'link8')" onMouseOut="HideTip('tt6')">jQuery.fn.hashchange</a> &ldquo;shortcut&rdquo; method.&nbsp; Added the <a href="#jQuery.param.sorted" class=LFunction id=link9 onMouseOver="ShowTip(event, 'tt7', 'link9')" onMouseOut="HideTip('tt7')">jQuery.param.sorted</a> method which reduces the possibility of extraneous hashchange event triggering.&nbsp; Added the <a href="#jQuery.param.fragment.ajaxCrawlable" class=LFunction id=link10 onMouseOver="ShowTip(event, 'tt8', 'link10')" onMouseOut="HideTip('tt8')">jQuery.param.fragment.ajaxCrawlable</a> method which can be used to enable Google &ldquo;AJAX Crawlable mode.&rdquo;</td></tr><tr><td class=CDLEntry>1.2.1</td><td class=CDLDescription>(2/17/2010) Actually fixed the stale window.location Safari bug from <a href="#jQuery_hashchange_event" class=LFile id=link11 onMouseOver="ShowTip(event, 'tt5', 'link11')" onMouseOut="HideTip('tt5')">jQuery hashchange event</a> in BBQ, which was the main reason for the previous release!</td></tr><tr><td class=CDLEntry>1.2</td><td class=CDLDescription>(2/16/2010) Integrated <a href="#jQuery_hashchange_event" class=LFile id=link12 onMouseOver="ShowTip(event, 'tt5', 'link12')" onMouseOut="HideTip('tt5')">jQuery hashchange event</a> v1.2, which fixes a Safari bug, the event can now be bound before DOM ready, and IE6/7 page should no longer scroll when the event is first bound.&nbsp; Also added the <a href="#jQuery.param.fragment.noEscape" class=LFunction id=link13 onMouseOver="ShowTip(event, 'tt9', 'link13')" onMouseOut="HideTip('tt9')">jQuery.param.fragment.noEscape</a> method, and reworked the <a href="#hashchange_event(BBQ)" class=LEvent id=link14 onMouseOver="ShowTip(event, 'tt10', 'link14')" onMouseOut="HideTip('tt10')">hashchange event (BBQ)</a> internal &ldquo;add&rdquo; method to be compatible with changes made to the jQuery 1.4.2 special events API.</td></tr><tr><td class=CDLEntry>1.1.1</td><td class=CDLDescription>(1/22/2010) Integrated <a href="#jQuery_hashchange_event" class=LFile id=link15 onMouseOver="ShowTip(event, 'tt5', 'link15')" onMouseOut="HideTip('tt5')">jQuery hashchange event</a> v1.1, which fixes an obscure IE8 EmulateIE7 meta tag compatibility mode bug.</td></tr><tr><td class=CDLEntry>1.1</td><td class=CDLDescription>(1/9/2010) Broke out the jQuery BBQ event.special <a href="#hashchange_event" class=LEvent id=link16 onMouseOver="ShowTip(event, 'tt3', 'link16')" onMouseOut="HideTip('tt3')">hashchange event</a> functionality into a separate plugin for users who want just the basic event &amp; back button support, without all the extra awesomeness that BBQ provides.&nbsp; This plugin will be included as part of jQuery BBQ, but also be available separately.&nbsp; See <a href="#jQuery_hashchange_event" class=LFile id=link17 onMouseOver="ShowTip(event, 'tt5', 'link17')" onMouseOut="HideTip('tt5')">jQuery hashchange event</a> plugin for more information.&nbsp; Also added the <a href="#jQuery.bbq.removeState" class=LFunction id=link18 onMouseOver="ShowTip(event, 'tt11', 'link18')" onMouseOut="HideTip('tt11')">jQuery.bbq.removeState</a> method and added additional <a href="#jQuery.deparam" class=LFunction id=link19 onMouseOver="ShowTip(event, 'tt12', 'link19')" onMouseOut="HideTip('tt12')">jQuery.deparam</a> examples.</td></tr><tr><td class=CDLEntry>1.0.3</td><td class=CDLDescription>(12/2/2009) Fixed an issue in IE 6 where location.search and location.hash would report incorrectly if the hash contained the ? character.&nbsp; Also <a href="#jQuery.param.querystring" class=LFunction id=link20 onMouseOver="ShowTip(event, 'tt13', 'link20')" onMouseOut="HideTip('tt13')">jQuery.param.querystring</a> and <a href="#jQuery.param.fragment" class=LFunction id=link21 onMouseOver="ShowTip(event, 'tt1', 'link21')" onMouseOut="HideTip('tt1')">jQuery.param.fragment</a> will no longer parse params out of a URL that doesn&rsquo;t contain ? or #, respectively.</td></tr><tr><td class=CDLEntry>1.0.2</td><td class=CDLDescription>(10/10/2009) Fixed an issue in IE 6/7 where the hidden IFRAME caused a &ldquo;This page contains both secure and nonsecure items.&rdquo; warning when used on an <a href="https://" class=LURL target=_top>https://</a> page.</td></tr><tr><td class=CDLEntry>1.0.1</td><td class=CDLDescription>(10/7/2009) Fixed an issue in IE 8.&nbsp; Since both &ldquo;IE7&rdquo; and &ldquo;IE8 Compatibility View&rdquo; modes erroneously report that the browser supports the native window.onhashchange event, a slightly more robust test needed to be added.</td></tr><tr><td class=CDLEntry>1.0</td><td class=CDLDescription>(10/2/2009) Initial release</td></tr></table></div></div></div>
<div class="CSection"><div class=CTopic><h2 class=CTitle><a name="Param(to_string)"></a>Param (to string)</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.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.href.</td></tr><tr class="SFunction SIndent1"><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 SIndent1 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.href.</td></tr><tr class="SFunction SIndent1"><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 SIndent1 SMarked"><td class=SEntry><a href="#jQuery.param.sorted" >jQuery.<wbr>param.<wbr>sorted</a></td><td class=SDescription>Returns a params string equivalent to that returned by the internal jQuery.param method, but sorted, which makes it suitable for use as a cache key.</td></tr><tr class="SFunction SIndent1"><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=link22 onMouseOver="ShowTip(event, 'tt1', 'link22')" onMouseOut="HideTip('tt1')">jQuery.param.fragment</a>, or when the fragment is modified using <a href="#jQuery.bbq.pushState" class=LFunction id=link23 onMouseOver="ShowTip(event, 'tt2', 'link23')" onMouseOut="HideTip('tt2')">jQuery.bbq.pushState</a>. </td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#jQuery.param.fragment.ajaxCrawlable" >jQuery.<wbr>param.<wbr>fragment.<wbr>ajaxCrawlable</a></td><td class=SDescription>TODO: DESCRIBE</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>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jQuery.param.querystring"></a>jQuery.<wbr>param.<wbr>querystring</h3><div class=CBody><p>Retrieve the query string from a URL or if no arguments are passed, the current window.location.href.</p><h4 class=CHeading>Usage</h4><blockquote><pre>jQuery.param.querystring( [ url ] );</pre></blockquote><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>url</td><td class=CDLDescription>(String) A URL containing query string params to be parsed.&nbsp; If url is not passed, the current window.location.href is used.</td></tr></table><h4 class=CHeading>Returns</h4><p>(String) The parsed query string, with any leading &ldquo;?&rdquo; removed.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jQuery.param.querystring(build_url)"></a>jQuery.<wbr>param.<wbr>querystring (build url)</h3><div class=CBody><p>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.</p><h4 class=CHeading>Usage</h4><blockquote><pre>jQuery.param.querystring( url, params [, merge_mode ] );</pre></blockquote><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>url</td><td class=CDLDescription>(String) A valid URL for params to be merged into.&nbsp; This URL may contain a query string and/or fragment (hash).</td></tr><tr><td class=CDLEntry>params</td><td class=CDLDescription>(String) A params string or URL containing query string params to be merged into url.</td></tr><tr><td class=CDLEntry>params</td><td class=CDLDescription>(Object) A params object to be merged into url.</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 query string params in url.</li><li>1: any query string params in url will override params in the params argument.</li><li>2: params argument will completely replace any query string in url.</li></ul><h4 class=CHeading>Returns</h4><p>(String) A URL with a urlencoded query string in the format &lsquo;?a=b&amp;c=d&amp;e=f&rsquo;.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jQuery.param.fragment"></a>jQuery.<wbr>param.<wbr>fragment</h3><div class=CBody><p>Retrieve the fragment (hash) from a URL or if no arguments are passed, the current window.location.href.</p><h4 class=CHeading>Usage</h4><blockquote><pre>jQuery.param.fragment( [ url ] );</pre></blockquote><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>url</td><td class=CDLDescription>(String) A URL containing fragment (hash) params to be parsed.&nbsp; If url is not passed, the current window.location.href is used.</td></tr></table><h4 class=CHeading>Returns</h4><p>(String) The parsed fragment (hash) string, with any leading &ldquo;#&rdquo; removed.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jQuery.param.fragment(build_url)"></a>jQuery.<wbr>param.<wbr>fragment (build url)</h3><div class=CBody><p>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.</p><h4 class=CHeading>Usage</h4><blockquote><pre>jQuery.param.fragment( url, params [, merge_mode ] );</pre></blockquote><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>url</td><td class=CDLDescription>(String) A valid URL for params to be merged into.&nbsp; This URL may contain a query string and/or fragment (hash).</td></tr><tr><td class=CDLEntry>params</td><td class=CDLDescription>(String) A params string or URL containing fragment (hash) params to be merged into url.</td></tr><tr><td class=CDLEntry>params</td><td class=CDLDescription>(Object) A params object to be merged into url.</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 fragment (hash) params in url.</li><li>1: any fragment (hash) params in url will override params in the params argument.</li><li>2: params argument will completely replace any query string in url.</li></ul><h4 class=CHeading>Returns</h4><p>(String) A URL with a urlencoded fragment (hash) in the format &lsquo;#a=b&amp;c=d&amp;e=f&rsquo;.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jQuery.param.sorted"></a>jQuery.<wbr>param.<wbr>sorted</h3><div class=CBody><p>Returns a params string equivalent to that returned by the internal jQuery.param method, but sorted, which makes it suitable for use as a cache key.</p><p>For example, in most browsers jQuery.param({z:1,a:2}) returns &ldquo;z=1&amp;a=2&rdquo; and jQuery.param({a:2,z:1}) returns &ldquo;a=2&amp;z=1&rdquo;.&nbsp; Even though both the objects being serialized and the resulting params strings are equivalent, if these params strings were set into the location.hash fragment sequentially, the hashchange event would be triggered unnecessarily, since the strings are different (even though the data described by them is the same).&nbsp; By sorting the params string, unecessary hashchange event triggering can be avoided.</p><h4 class=CHeading>Usage</h4><blockquote><pre>jQuery.param.sorted( obj [, traditional ] );</pre></blockquote><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription>(Object) An object to be serialized.</td></tr><tr><td class=CDLEntry>traditional</td><td class=CDLDescription>(Boolean) Params deep/shallow serialization mode.&nbsp; See the documentation at <a href="http://api.jquery.com/jQuery.param/" class=LURL target=_top>http://api.jquery.com/jQuery.param/</a> for more detail.</td></tr></table><h4 class=CHeading>Returns</h4><p>(String) A sorted params string.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jQuery.param.fragment.noEscape"></a>jQuery.<wbr>param.<wbr>fragment.<wbr>noEscape</h3><div class=CBody><p>Specify characters that will be left unescaped when fragments are created or merged using <a href="#jQuery.param.fragment" class=LFunction id=link24 onMouseOver="ShowTip(event, 'tt1', 'link24')" onMouseOut="HideTip('tt1')">jQuery.param.fragment</a>, or when the fragment is modified using <a href="#jQuery.bbq.pushState" class=LFunction id=link25 onMouseOver="ShowTip(event, 'tt2', 'link25')" onMouseOut="HideTip('tt2')">jQuery.bbq.pushState</a>.&nbsp; This option only applies to serialized data object fragments, and not set-as-string fragments.&nbsp; Does not affect the query string.&nbsp; Defaults to &ldquo;,/&rdquo; (comma, forward slash).</p><p>Note that this is considered a purely aesthetic option, and will help to create URLs that &ldquo;look pretty&rdquo; in the address bar or bookmarks, without affecting functionality in any way.&nbsp; That being said, be careful to not unescape characters that are used as delimiters or serve a special purpose, such as the &ldquo;#?&amp;=+&rdquo; (octothorpe, question mark, ampersand, equals, plus) characters.</p><h4 class=CHeading>Usage</h4><blockquote><pre>jQuery.param.fragment.noEscape( [ chars ] );</pre></blockquote><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>chars</td><td class=CDLDescription>(String) The characters to not escape in the fragment.&nbsp; If unspecified, defaults to empty string (escape all characters).</td></tr></table><h4 class=CHeading>Returns</h4><p>Nothing.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jQuery.param.fragment.ajaxCrawlable"></a>jQuery.<wbr>param.<wbr>fragment.<wbr>ajaxCrawlable</h3><div class=CBody><p>TODO: DESCRIBE</p><h4 class=CHeading>Usage</h4><blockquote><pre>jQuery.param.fragment.ajaxCrawlable( [ state ] );</pre></blockquote><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>state</td><td class=CDLDescription>(Boolean) TODO: DESCRIBE</td></tr></table><h4 class=CHeading>Returns</h4><p>(Boolean) The current ajaxCrawlable state.</p></div></div></div>
<div class="CSection"><div class=CTopic><h2 class=CTitle><a name="Deparam(from_string)"></a>Deparam (from string)</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.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 SIndent1"><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.href, deserializing it into an object, optionally coercing numbers, booleans, null and undefined values.</td></tr><tr class="SFunction SIndent1 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.href, deserializing it into an object, optionally coercing numbers, booleans, null and undefined values.</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>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jQuery.deparam"></a>jQuery.<wbr>deparam</h3><div class=CBody><p>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.</p><h4 class=CHeading>Usage</h4><blockquote><pre>jQuery.deparam( params [, coerce ] );</pre></blockquote><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>params</td><td class=CDLDescription>(String) A params string to be parsed.</td></tr><tr><td class=CDLEntry>coerce</td><td class=CDLDescription>(Boolean) If true, coerces any numbers or true, false, null, and undefined to their actual value.&nbsp; Defaults to false if omitted.</td></tr></table><h4 class=CHeading>Returns</h4><p>(Object) An object representing the deserialized params string.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jQuery.deparam.querystring"></a>jQuery.<wbr>deparam.<wbr>querystring</h3><div class=CBody><p>Parse the query string from a URL or the current window.location.href, deserializing it into an object, optionally coercing numbers, booleans, null and undefined values.</p><h4 class=CHeading>Usage</h4><blockquote><pre>jQuery.deparam.querystring( [ url ] [, coerce ] );</pre></blockquote><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>url</td><td class=CDLDescription>(String) An optional params string or URL containing query string params to be parsed.&nbsp; If url is omitted, the current window.location.href is used.</td></tr><tr><td class=CDLEntry>coerce</td><td class=CDLDescription>(Boolean) If true, coerces any numbers or true, false, null, and undefined to their actual value.&nbsp; Defaults to false if omitted.</td></tr></table><h4 class=CHeading>Returns</h4><p>(Object) An object representing the deserialized params string.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jQuery.deparam.fragment"></a>jQuery.<wbr>deparam.<wbr>fragment</h3><div class=CBody><p>Parse the fragment (hash) from a URL or the current window.location.href, deserializing it into an object, optionally coercing numbers, booleans, null and undefined values.</p><h4 class=CHeading>Usage</h4><blockquote><pre>jQuery.deparam.fragment( [ url ] [, coerce ] );</pre></blockquote><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>url</td><td class=CDLDescription>(String) An optional params string or URL containing fragment (hash) params to be parsed.&nbsp; If url is omitted, the current window.location.href is used.</td></tr><tr><td class=CDLEntry>coerce</td><td class=CDLDescription>(Boolean) If true, coerces any numbers or true, false, null, and undefined to their actual value.&nbsp; Defaults to false if omitted.</td></tr></table><h4 class=CHeading>Returns</h4><p>(Object) An object representing the deserialized params string.</p></div></div></div>
<div class="CSection"><div class=CTopic><h2 class=CTitle><a name="Element_manipulation"></a>Element manipulation</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.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 SIndent1"><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 SIndent1 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></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>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jQuery.elemUrlAttr"></a>jQuery.<wbr>elemUrlAttr</h3><div class=CBody><p>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.</p><p>In the <a href="#jQuery.fn.querystring" class=LFunction id=link26 onMouseOver="ShowTip(event, 'tt14', 'link26')" onMouseOut="HideTip('tt14')">jQuery.fn.querystring</a> and <a href="#jQuery.fn.fragment" class=LFunction id=link27 onMouseOver="ShowTip(event, 'tt15', 'link27')" onMouseOut="HideTip('tt15')">jQuery.fn.fragment</a> methods, this list is used to determine which attribute contains the URL to be modified, if an &ldquo;attr&rdquo; param is not specified.</p><h4 class=CHeading>Default Tag-Attribute List</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>a</td><td class=CDLDescription>href</td></tr><tr><td class=CDLEntry>base</td><td class=CDLDescription>href</td></tr><tr><td class=CDLEntry>iframe</td><td class=CDLDescription>src</td></tr><tr><td class=CDLEntry>img</td><td class=CDLDescription>src</td></tr><tr><td class=CDLEntry>input</td><td class=CDLDescription>src</td></tr><tr><td class=CDLEntry>form</td><td class=CDLDescription>action</td></tr><tr><td class=CDLEntry>link</td><td class=CDLDescription>href</td></tr><tr><td class=CDLEntry>script</td><td class=CDLDescription>src</td></tr></table><h4 class=CHeading>Usage</h4><blockquote><pre>jQuery.elemUrlAttr( [ tag_attr ] );</pre></blockquote><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>tag_attr</td><td class=CDLDescription>(Object) An object containing a list of tag names and their associated default attribute names in the format { tag: &lsquo;attr&rsquo;, ...&nbsp; } to be merged into the internal tag-attribute list.</td></tr></table><h4 class=CHeading>Returns</h4><p>(Object) An object containing all stored tag-attribute values.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jQuery.fn.querystring"></a>jQuery.<wbr>fn.<wbr>querystring</h3><div class=CBody><p>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.&nbsp; Like <a href="#jQuery.param.querystring(build_url)" class=LFunction id=link28 onMouseOver="ShowTip(event, 'tt16', 'link28')" onMouseOut="HideTip('tt16')">jQuery.param.querystring (build url)</a>, but for all elements in a jQuery collection.</p><h4 class=CHeading>Usage</h4><blockquote><pre>jQuery('selector').querystring( [ 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 or url into.&nbsp; See <a href="#jQuery.elemUrlAttr" class=LFunction id=link29 onMouseOver="ShowTip(event, 'tt17', 'link29')" onMouseOut="HideTip('tt17')">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 query string 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 query string 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="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=link30 onMouseOver="ShowTip(event, 'tt18', 'link30')" onMouseOut="HideTip('tt18')">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=link31 onMouseOver="ShowTip(event, 'tt17', 'link31')" onMouseOut="HideTip('tt17')">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=link32 onMouseOver="ShowTip(event, 'tt3', 'link32')" 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=link33 onMouseOver="ShowTip(event, 'tt3', 'link33')" 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.3, Last updated: 7/21/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>These working examples, complete with fully commented code, illustrate a few ways 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="#Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent1 SMarked"><td class=SEntry><a href="#jQuery.fn.hashchange" >jQuery.<wbr>fn.<wbr>hashchange</a></td><td class=SDescription>Bind a handler to the window.onhashchange event or trigger all bound window.onhashchange event handlers. </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.fn.hashchange.delay" >jQuery.<wbr>fn.<wbr>hashchange.<wbr>delay</a></td><td class=SDescription>The numeric interval (in milliseconds) at which the <a href="#hashchange_event" class=LEvent id=link34 onMouseOver="ShowTip(event, 'tt3', 'link34')" onMouseOut="HideTip('tt3')">hashchange event</a> polling loop executes. </td></tr><tr class="SProperty SIndent1"><td class=SEntry><a href="#jQuery.fn.hashchange.domain" >jQuery.<wbr>fn.<wbr>hashchange.<wbr>domain</a></td><td class=SDescription>If you&rsquo;re setting document.domain in your JavaScript, and you want hash history to work in IE6/7, not only must this property be set, but you must also set document.domain BEFORE jQuery is loaded into the page. </td></tr><tr class="SProperty SIndent1 SMarked"><td class=SEntry><a href="#jQuery.fn.hashchange.src" >jQuery.<wbr>fn.<wbr>hashchange.src</a></td><td class=SDescription>If, for some reason, you need to specify an Iframe src file (for example, when setting document.domain as in <a href="#jQuery.fn.hashchange.domain" class=LProperty id=link35 onMouseOver="ShowTip(event, 'tt4', 'link35')" onMouseOut="HideTip('tt4')">jQuery.fn.hashchange.domain</a>), you can do so using this property. </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>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jQuery.bbq.pushState"></a>jQuery.<wbr>bbq.<wbr>pushState</h3><div class=CBody><p>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=link36 onMouseOver="ShowTip(event, 'tt3', 'link36')" onMouseOut="HideTip('tt3')">hashchange event</a> callbacks (provided the new state is different than the previous state).</p><p>If no arguments are passed, an empty state is created, which is just a shortcut for jQuery.bbq.pushState( {}, 2 ).</p><h4 class=CHeading>Usage</h4><blockquote><pre>jQuery.bbq.pushState( [ params [, merge_mode ] ] );</pre></blockquote><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>params</td><td class=CDLDescription>(String) A serialized params string or a hash string beginning with # to merge into location.hash.</td></tr><tr><td class=CDLEntry>params</td><td class=CDLDescription>(Object) A params object to merge into location.hash.</td></tr><tr><td class=CDLEntry>merge_mode</td><td class=CDLDescription>(Number) Merge behavior defaults to 0 if merge_mode is not specified (unless a hash string beginning with # is specified, in which case merge behavior defaults to 2), and is as-follows:</td></tr></table><ul><li>0: params in the params argument will override any params in the current state.</li><li>1: any params in the current state will override params in the params argument.</li><li>2: params argument will completely replace current state.</li></ul><h4 class=CHeading>Returns</h4><p>Nothing.</p><h4 class=CHeading>Additional Notes</h4><ul><li>Setting an empty state may cause the browser to scroll.</li><li>Unlike the fragment and querystring methods, if a hash string beginning with # is specified as the params agrument, merge_mode defaults to 2.</li></ul></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jQuery.bbq.getState"></a>jQuery.<wbr>bbq.<wbr>getState</h3><div class=CBody><p>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.</p><h4 class=CHeading>Usage</h4><blockquote><pre>jQuery.bbq.getState( [ key ] [, coerce ] );</pre></blockquote><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>key</td><td class=CDLDescription>(String) An optional state key for which to return a value.</td></tr><tr><td class=CDLEntry>coerce</td><td class=CDLDescription>(Boolean) If true, coerces any numbers or true, false, null, and undefined to their actual value.&nbsp; Defaults to false.</td></tr></table><h4 class=CHeading>Returns</h4><p>(Anything) If key is passed, returns the value corresponding with that key in the location.hash &lsquo;state&rsquo;, or undefined.&nbsp; If not, an object representing the entire &lsquo;state&rsquo; is returned.</p></div></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jQuery.bbq.removeState"></a>jQuery.<wbr>bbq.<wbr>removeState</h3><div class=CBody><p>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=link37 onMouseOver="ShowTip(event, 'tt3', 'link37')" onMouseOut="HideTip('tt3')">hashchange event</a> callbacks (provided the new state is different than the previous state).</p><p>If no arguments are passed, an empty state is created, which is just a shortcut for jQuery.bbq.pushState( {}, 2 ).</p><h4 class=CHeading>Usage</h4><blockquote><pre>jQuery.bbq.removeState( [ key [, key ... ] ] );</pre></blockquote><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>key</td><td class=CDLDescription>(String) One or more key values to remove from the current state, passed as individual arguments.</td></tr><tr><td class=CDLEntry>key</td><td class=CDLDescription>(Array) A single array argument that contains a list of key values to remove from the current state.</td></tr></table><h4 class=CHeading>Returns</h4><p>Nothing.</p><h4 class=CHeading>Additional Notes</h4><ul><li>Setting an empty state may cause the browser to scroll.</li></ul></div></div></div>
<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 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=link38 onMouseOver="ShowTip(event, 'tt1', 'link38')" onMouseOut="HideTip('tt1')">jQuery.param.fragment</a> and the event.getState method is equivalent to the <a href="#jQuery.bbq.getState" class=LFunction id=link39 onMouseOver="ShowTip(event, 'tt19', 'link39')" onMouseOut="HideTip('tt19')">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 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=link40 onMouseOver="ShowTip(event, 'tt1', 'link40')" onMouseOut="HideTip('tt1')">jQuery.param.fragment</a> and <a href="#jQuery.bbq.getState" class=LFunction id=link41 onMouseOver="ShowTip(event, 'tt19', 'link41')" onMouseOut="HideTip('tt19')">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' ),
param_val_coerced = $.bbq.getState( 'param_name', true );
...
});</pre></blockquote><h4 class=CHeading>Additional Notes</h4><ul><li>Due to changes in the special events API, jQuery BBQ v1.2 or newer is required to enable the augmented event object in jQuery 1.4.2 and newer.</li><li>See <a href="#jQuery_hashchange_event" class=LFile id=link42 onMouseOver="ShowTip(event, 'tt5', 'link42')" onMouseOut="HideTip('tt5')">jQuery hashchange event</a> for more detailed information.</li></ul></div></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Files"></a>Files</h3></div></div>
<div class="CFile"><div class=CTopic><h3 class=CTitle><a name="jQuery_hashchange_event"></a>jQuery hashchange event</h3><div class=CBody><p><b>Version: 1.3, Last updated: 7/21/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-hashchange-plugin/" class=LURL target=_top>http://benalman.com<wbr>/projects<wbr>/jquery-hashchange-plugin<wbr>/</a></td></tr><tr><td class=CDLEntry>GitHub</td><td class=CDLDescription><a href="http://github.com/cowboy/jquery-hashchange/" class=LURL target=_top>http://github.com/cowboy/jquery-hashchange/</a></td></tr><tr><td class=CDLEntry>Source</td><td class=CDLDescription><a href="http://github.com/cowboy/jquery-hashchange/raw/master/jquery.ba-hashchange.js" class=LURL target=_top>http://github.com<wbr>/cowboy<wbr>/jquery-hashchange<wbr>/raw<wbr>/master<wbr>/jquery.ba-hashchange.js</a></td></tr><tr><td class=CDLEntry>(Minified)</td><td class=CDLDescription><a href="http://github.com/cowboy/jquery-hashchange/raw/master/jquery.ba-hashchange.min.js" class=LURL target=_top>http://github.com<wbr>/cowboy<wbr>/jquery-hashchange<wbr>/raw<wbr>/master<wbr>/jquery.ba-hashchange.min.js</a> (0.8kb gzipped)</td></tr></table></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>
<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="Examples"></a>Examples</h3><div class=CBody><p>These working examples, complete with fully commented code, illustrate a few ways in which this plugin can be used.</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>hashchange event</td><td class=CDLDescription><a href="http://benalman.com/code/projects/jquery-hashchange/examples/hashchange/" class=LURL target=_top>http://benalman.com<wbr>/code<wbr>/projects<wbr>/jquery-hashchange<wbr>/examples<wbr>/hashchange<wbr>/</a></td></tr><tr><td class=CDLEntry>document.domain</td><td class=CDLDescription><a href="http://benalman.com/code/projects/jquery-hashchange/examples/document_domain/" class=LURL target=_top>http://benalman.com<wbr>/code<wbr>/projects<wbr>/jquery-hashchange<wbr>/examples<wbr>/document_domain<wbr>/</a></td></tr></table></div></div></div>
<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="Support_and_Testing"></a>Support and Testing</h3><div class=CBody><p>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).</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>jQuery Versions</td><td class=CDLDescription>1.2.6, 1.3.2, 1.4.1, 1.4.2</td></tr><tr><td class=CDLEntry>Browsers Tested</td><td class=CDLDescription>Internet Explorer 6-8, Firefox 2-4, Chrome 5-6, Safari 3.2-5, Opera 9.6-10.60, iPhone 3.1, Android 1.6-2.2, BlackBerry 4.6-5.</td></tr><tr><td class=CDLEntry>Unit Tests</td><td class=CDLDescription><a href="http://benalman.com/code/projects/jquery-hashchange/unit/" class=LURL target=_top>http://benalman.com<wbr>/code<wbr>/projects<wbr>/jquery-hashchange<wbr>/unit<wbr>/</a></td></tr></table></div></div></div>
<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="Known_issues"></a>Known issues</h3><div class=CBody><p>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.&nbsp; See the following examples for more information:</p><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>Chrome: Back Button</td><td class=CDLDescription><a href="http://benalman.com/code/projects/jquery-hashchange/examples/bug-chrome-back-button/" class=LURL target=_top>http://benalman.com<wbr>/code<wbr>/projects<wbr>/jquery-hashchange<wbr>/examples<wbr>/bug-chrome-back-button<wbr>/</a></td></tr><tr><td class=CDLEntry>Firefox: Remote XMLHttpRequest</td><td class=CDLDescription><a href="http://benalman.com/code/projects/jquery-hashchange/examples/bug-firefox-remote-xhr/" class=LURL target=_top>http://benalman.com<wbr>/code<wbr>/projects<wbr>/jquery-hashchange<wbr>/examples<wbr>/bug-firefox-remote-xhr<wbr>/</a></td></tr><tr><td class=CDLEntry>WebKit: Back Button in an Iframe</td><td class=CDLDescription><a href="http://benalman.com/code/projects/jquery-hashchange/examples/bug-webkit-hash-iframe/" class=LURL target=_top>http://benalman.com<wbr>/code<wbr>/projects<wbr>/jquery-hashchange<wbr>/examples<wbr>/bug-webkit-hash-iframe<wbr>/</a></td></tr><tr><td class=CDLEntry>Safari: Back Button from a different domain</td><td class=CDLDescription><a href="http://benalman.com/code/projects/jquery-hashchange/examples/bug-safari-back-from-diff-domain/" class=LURL target=_top>http://benalman.com<wbr>/code<wbr>/projects<wbr>/jquery-hashchange<wbr>/examples<wbr>/bug-safari-back-from-diff-domain<wbr>/</a></td></tr></table><p>Also note that should a browser natively support the window.onhashchange event, but not report that it does, the fallback polling loop will be used.</p></div></div></div>
<div class="CGeneric"><div class=CTopic><h3 class=CTitle><a name="Release_History"></a>Release History</h3><div class=CBody><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>1.3</td><td class=CDLDescription>(7/21/2010) Reorganized IE6/7 Iframe code to make it more &ldquo;removable&rdquo; for mobile-only development.&nbsp; Added IE6/7 document.title support.&nbsp; Attempted to make Iframe as hidden as possible by using techniques from <a href="http://www.paciellogroup.com/blog/?p=604" class=LURL target=_top>http://www.paciellogroup.com/blog/?p=604</a>.&nbsp; Added support for the &ldquo;shortcut&rdquo; format $(window).hashchange( fn ) and $(window).hashchange() like jQuery provides for built-in events.&nbsp; Renamed jQuery.hashchangeDelay to <a href="#jQuery.fn.hashchange.delay" class=LProperty id=link43 onMouseOver="ShowTip(event, 'tt20', 'link43')" onMouseOut="HideTip('tt20')">jQuery.fn.hashchange.delay</a> and lowered its default value to 50.&nbsp; Added <a href="#jQuery.fn.hashchange.domain" class=LProperty id=link44 onMouseOver="ShowTip(event, 'tt4', 'link44')" onMouseOut="HideTip('tt4')">jQuery.fn.hashchange.domain</a> and <a href="#jQuery.fn.hashchange.src" class=LProperty id=link45 onMouseOver="ShowTip(event, 'tt21', 'link45')" onMouseOut="HideTip('tt21')">jQuery.fn.hashchange.src</a> properties plus document-domain.html file to address access denied issues when setting document.domain in IE6/7.</td></tr><tr><td class=CDLEntry>1.2</td><td class=CDLDescription>(2/11/2010) Fixed a bug where coming back to a page using this plugin from a page on another domain would cause an error in Safari 4.&nbsp; Also, IE6/7 Iframe is now inserted after the body (this actually works), which prevents the page from scrolling when the event is first bound.&nbsp; Event can also now be bound before DOM ready, but it won&rsquo;t be usable before then in IE6/7.</td></tr><tr><td class=CDLEntry>1.1</td><td class=CDLDescription>(1/21/2010) Incorporated document.documentMode test to fix IE8 bug where browser version is incorrectly reported as 8.0, despite inclusion of the X-UA-Compatible IE=EmulateIE7 meta tag.</td></tr><tr><td class=CDLEntry>1.0</td><td class=CDLDescription>(1/9/2010) Initial Release.&nbsp; Broke out the jQuery BBQ event.special window.onhashchange functionality into a separate plugin for users who want just the basic event &amp; back button support, without all the extra awesomeness that BBQ provides.&nbsp; This plugin will be included as part of jQuery BBQ, but also be available separately.</td></tr></table></div></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Functions"></a>Functions</h3></div></div>
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="jQuery.fn.hashchange"></a>jQuery.<wbr>fn.<wbr>hashchange</h3><div class=CBody><p>Bind a handler to the window.onhashchange event or trigger all bound window.onhashchange event handlers.&nbsp; This behavior is consistent with jQuery&rsquo;s built-in event handlers.</p><h4 class=CHeading>Usage</h4><blockquote><pre>jQuery(window).hashchange( [ handler ] );</pre></blockquote><h4 class=CHeading>Arguments</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>handler</td><td class=CDLDescription>(Function) Optional handler to be bound to the hashchange event.&nbsp; This is a &ldquo;shortcut&rdquo; for the more verbose form: jQuery(window).bind( &lsquo;hashchange&rsquo;, handler ).&nbsp; If handler is omitted, all bound window.onhashchange event handlers will be triggered.&nbsp; This is a shortcut for the more verbose jQuery(window).trigger( &lsquo;hashchange&rsquo; ).&nbsp; These forms are described in the <a href="#hashchange_event" class=LEvent id=link46 onMouseOver="ShowTip(event, 'tt3', 'link46')" onMouseOut="HideTip('tt3')">hashchange event</a> section.</td></tr></table><h4 class=CHeading>Returns</h4><p>(jQuery) The initial jQuery collection of elements.</p></div></div></div>
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="Properties"></a>Properties</h3></div></div>
<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="jQuery.fn.hashchange.delay"></a>jQuery.<wbr>fn.<wbr>hashchange.<wbr>delay</h3><div class=CBody><p>The numeric interval (in milliseconds) at which the <a href="#hashchange_event" class=LEvent id=link47 onMouseOver="ShowTip(event, 'tt3', 'link47')" onMouseOut="HideTip('tt3')">hashchange event</a> polling loop executes.&nbsp; Defaults to 50.</p></div></div></div>
<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="jQuery.fn.hashchange.domain"></a>jQuery.<wbr>fn.<wbr>hashchange.<wbr>domain</h3><div class=CBody><p>If you&rsquo;re setting document.domain in your JavaScript, and you want hash history to work in IE6/7, not only must this property be set, but you must also set document.domain BEFORE jQuery is loaded into the page.&nbsp; This property is only applicable if you are supporting IE6/7 (or IE8 operating in &ldquo;IE7 compatibility&rdquo; mode).</p><p>In addition, the <a href="#jQuery.fn.hashchange.src" class=LProperty id=link48 onMouseOver="ShowTip(event, 'tt21', 'link48')" onMouseOut="HideTip('tt21')">jQuery.fn.hashchange.src</a> property must be set to the path of the included &ldquo;document-domain.html&rdquo; file, which can be renamed or modified if necessary (note that the document.domain specified must be the same in both your main JavaScript as well as in this file).</p><h4 class=CHeading>Usage</h4><p>jQuery.fn.hashchange.domain = document.domain;</p></div></div></div>
<div class="CProperty"><div class=CTopic><h3 class=CTitle><a name="jQuery.fn.hashchange.src"></a>jQuery.<wbr>fn.<wbr>hashchange.src</h3><div class=CBody><p>If, for some reason, you need to specify an Iframe src file (for example, when setting document.domain as in <a href="#jQuery.fn.hashchange.domain" class=LProperty id=link49 onMouseOver="ShowTip(event, 'tt4', 'link49')" onMouseOut="HideTip('tt4')">jQuery.fn.hashchange.domain</a>), you can do so using this property.&nbsp; Note that when using this property, history won&rsquo;t be recorded in IE6/7 until the Iframe src file loads.&nbsp; This property is only applicable if you are supporting IE6/7 (or IE8 operating in &ldquo;IE7 compatibility&rdquo; mode).</p><h4 class=CHeading>Usage</h4><p>jQuery.fn.hashchange.src = &lsquo;path/to/file.html&rsquo;;</p></div></div></div>
<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"></a>hashchange event</h3><div class=CBody><p>Fired when location.hash changes.&nbsp; In browsers that support it, the native HTML5 window.onhashchange event is used, otherwise a polling loop is initialized, running every <a href="#jQuery.fn.hashchange.delay" class=LProperty id=link50 onMouseOver="ShowTip(event, 'tt20', 'link50')" onMouseOut="HideTip('tt20')">jQuery.fn.hashchange.delay</a> milliseconds to see if the hash has changed.&nbsp; In IE6/7 (and IE8 operating in &ldquo;IE7 compatibility&rdquo; mode), a hidden Iframe is created to allow the back button and hash-based history to work.</p><h4 class=CHeading>Usage as described in <a href="#jQuery.fn.hashchange" class=LFunction id=link51 onMouseOver="ShowTip(event, 'tt6', 'link51')" onMouseOut="HideTip('tt6')">jQuery.fn.hashchange</a></h4><blockquote><pre>// Bind an event handler.
jQuery(window).hashchange( function(e) {
var hash = location.hash;
...
});
// Manually trigger the event handler.
jQuery(window).hashchange();</pre></blockquote><h4 class=CHeading>A more verbose usage that allows for event namespacing</h4><blockquote><pre>// Bind an event handler.
jQuery(window).bind( 'hashchange', function(e) {
var hash = location.hash;
...
});
// Manually trigger the event handler.
jQuery(window).trigger( 'hashchange' );</pre></blockquote><h4 class=CHeading>Additional Notes</h4><ul><li>The polling loop and Iframe are not created until at least one handler is actually bound to the &lsquo;hashchange&rsquo; event.</li><li>If you need the bound handler(s) to execute immediately, in cases where a location.hash exists on page load, via bookmark or page refresh for example, use jQuery(window).hashchange() or the more verbose jQuery(window).trigger( &lsquo;hashchange&rsquo; ).</li><li>The event can be bound before DOM ready, but since it won&rsquo;t be usable before then in IE6/7 (due to the necessary Iframe), recommended usage is to bind it inside a DOM ready handler.</li></ul></div></div></div>
</div><!--Content-->
<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
<div id=Menu><div class=MEntry><div class=MFile id=MSelected>jQuery BBQ: Back Button &amp; Query Library</div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Index</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MIndex><a href="../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Events.html">Events</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Files.html">Files</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../index/Properties.html">Properties</a></div></div></div></div></div><script type="text/javascript"><!--
var searchPanel = new SearchPanel("searchPanel", "HTML", "../search");
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option id=MSearchEverything selected value="General">Everything</option><option value="Events">Events</option><option value="Files">Files</option><option value="Functions">Functions</option><option value="Properties">Properties</option></select></div></div><!--Menu-->
<!--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.href.</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=CProperty>If you&rsquo;re setting document.domain in your JavaScript, and you want hash history to work in IE6/7, not only must this property be set, but you must also set document.domain BEFORE jQuery is loaded into the page. </div></div><div class=CToolTip id="tt5"><div class=CFile><b>Version: 1.3, Last updated: 7/21/2010</b></div></div><div class=CToolTip id="tt6"><div class=CFunction>Bind a handler to the window.onhashchange event or trigger all bound window.onhashchange event handlers. </div></div><div class=CToolTip id="tt7"><div class=CFunction>Returns a params string equivalent to that returned by the internal jQuery.param method, but sorted, which makes it suitable for use as a cache key.</div></div><div class=CToolTip id="tt8"><div class=CFunction>TODO: DESCRIBE</div></div><div class=CToolTip id="tt9"><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="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=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="tt12"><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="tt13"><div class=CFunction>Retrieve the query string from a URL or if no arguments are passed, the current window.location.href.</div></div><div class=CToolTip id="tt14"><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="tt15"><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="tt16"><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="tt17"><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="tt18"><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="tt19"><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="tt20"><div class=CProperty>The numeric interval (in milliseconds) at which the hashchange event polling loop executes. </div></div><div class=CToolTip id="tt21"><div class=CProperty>If, for some reason, you need to specify an Iframe src file (for example, when setting document.domain as in jQuery.fn.hashchange.domain), you can do so using this property. </div></div><!--END_ND_TOOLTIPS-->
<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>
<script language=JavaScript><!--
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html>
Jump to Line
Something went wrong with that request. Please try again.