Permalink
Browse files

Added $.fn.hashchange shortcut method, other minor tweaks.

  • Loading branch information...
1 parent 269e0ed commit 20265f9f6b1d3d8bc0d9eea3945aac109b89b105 @cowboy committed Jul 20, 2010
View
@@ -1,7 +1,7 @@
# jQuery hashchange event #
[http://benalman.com/projects/jquery-hashchange-plugin/](http://benalman.com/projects/jquery-hashchange-plugin/)
-Version: 1.3pre, Last updated: 7/6/2010
+Version: 1.3pre, Last updated: 7/17/2010
This jQuery plugin enables very basic bookmarkable #hash history via a cross-browser window.onhashchange event.
@@ -13,10 +13,11 @@ Visit the [project page](http://benalman.com/projects/jquery-hashchange-plugin/)
## Examples ##
-This working example, complete with fully commented code, illustrates one way
-in which this plugin can be used.
+These working examples, complete with fully commented code, illustrate a few
+ways in which this plugin can be used.
[http://benalman.com/code/projects/jquery-hashchange/examples/hashchange/](http://benalman.com/code/projects/jquery-hashchange/examples/hashchange/)
+[http://benalman.com/code/projects/jquery-hashchange/examples/document_domain/](http://benalman.com/code/projects/jquery-hashchange/examples/document_domain/)
## Support and Testing ##
Information about what version or versions of jQuery this plugin has been
@@ -54,10 +55,13 @@ WebKit: Back Button in an Iframe
Safari: Back Button from a different domain
[http://benalman.com/code/projects/jquery-hashchange/examples/bug-safari-back-from-diff-domain/](http://benalman.com/code/projects/jquery-hashchange/examples/bug-safari-back-from-diff-domain/)
+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.
+
## Release History ##
-1.3pre - (7/6/2010) Reorganized IE6/7 Iframe code to make it more "removable" for mobile development. Added jQuery.hashchangeDomain, jQuery.hashchangeIframeSrc properties and document-domain.html file to address access denied issues when setting document.domain in IE6/7. Note that when using jQuery.hashchangeIframeSrc, history won't be recorded in IE6/7 until the Iframe src file loads. Lowered the default jQuery.hashchangeDelay to 50 milliseconds. Added IE6/7 document.title support. Attempt to make Iframe as hidden as possible by using techniques from http://www.paciellogroup.com/blog/?p=604.
+1.3pre - (7/17/2010) Reorganized IE6/7 Iframe code to make it more "removable" for mobile development. Added jQuery.hashchangeDomain, jQuery.hashchangeIframeSrc properties and document-domain.html file to address access denied issues when setting document.domain in IE6/7. Note that when using jQuery.hashchangeIframeSrc, history won't be recorded in IE6/7 until the Iframe src file loads. Lowered the default jQuery.hashchangeDelay to 50 milliseconds. Added IE6/7 document.title support. Attempt to make Iframe as hidden as possible by using techniques from http://www.paciellogroup.com/blog/?p=604. Added support for the "shortcut" format $(window).hashchange( fn ) and $(window).hashchange() like jQuery does for built-in events.
1.2 - (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. 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. Event can also now be bound before DOM ready, but it won't be usable before then in IE6/7.
1.1 - (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.
1.0 - (1/9/2010) Initial Release. Broke out the jQuery BBQ event.special window.onhashchange functionality into a separate plugin for users who want just the basic event & back button support, without all the extra awesomeness that BBQ provides. This plugin will be included as part of jQuery BBQ, but also be available separately.

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -21,9 +21,9 @@
<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><a href="../files/jquery-ba-hashchange-js.html">jQuery hashchange event</a></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="General.html">Everything</a></div></div><div class=MEntry><div class=MIndex id=MSelected>Events</div></div><div class=MEntry><div class=MIndex><a href="Files.html">Files</a></div></div><div class=MEntry><div class=MIndex><a href="Properties.html">Properties</a></div></div></div></div></div><script type="text/javascript"><!--
+<div id=Menu><div class=MEntry><div class=MFile><a href="../files/jquery-ba-hashchange-js.html">jQuery hashchange event</a></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="General.html">Everything</a></div></div><div class=MEntry><div class=MIndex id=MSelected>Events</div></div><div class=MEntry><div class=MIndex><a href="Files.html">Files</a></div></div><div class=MEntry><div class=MIndex><a href="Properties.html">Properties</a></div></div><div class=MEntry><div class=MIndex><a href="Functions.html">Functions</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="Properties">Properties</option></select></div></div><!--Menu-->
+--></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-->
<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>
View
@@ -13,17 +13,17 @@
<div id=Index><div class=IPageTitle>File Index</div><div class=INavigationBar>$#! &middot; 0-9 &middot; A &middot; B &middot; C &middot; D &middot; E &middot; F &middot; G &middot; H &middot; I &middot; <a href="#J">J</a> &middot; K &middot; L &middot; M &middot; N &middot; O &middot; P &middot; Q &middot; R &middot; S &middot; T &middot; U &middot; V &middot; W &middot; X &middot; Y &middot; Z</div><table border=0 cellspacing=0 cellpadding=0><tr><td class=IHeading id=IFirstHeading><a name="J"></a>J</td><td></td></tr><tr><td class=ISymbolPrefix id=IOnlySymbolPrefix>&nbsp;</td><td class=IEntry><a href="../files/jquery-ba-hashchange-js.html#jQuery_hashchange_event" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')" class=ISymbol>jQuery hashchange event</a></td></tr></table>
<!--START_ND_TOOLTIPS-->
-<div class=CToolTip id="tt1"><div class=CFile><b>Version: 1.3pre, Last updated: 7/6/2010</b></div></div><!--END_ND_TOOLTIPS-->
+<div class=CToolTip id="tt1"><div class=CFile><b>Version: 1.3pre, Last updated: 7/17/2010</b></div></div><!--END_ND_TOOLTIPS-->
</div><!--Index-->
<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><a href="../files/jquery-ba-hashchange-js.html">jQuery hashchange event</a></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="General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="Events.html">Events</a></div></div><div class=MEntry><div class=MIndex id=MSelected>Files</div></div><div class=MEntry><div class=MIndex><a href="Properties.html">Properties</a></div></div></div></div></div><script type="text/javascript"><!--
+<div id=Menu><div class=MEntry><div class=MFile><a href="../files/jquery-ba-hashchange-js.html">jQuery hashchange event</a></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="General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="Events.html">Events</a></div></div><div class=MEntry><div class=MIndex id=MSelected>Files</div></div><div class=MEntry><div class=MIndex><a href="Properties.html">Properties</a></div></div><div class=MEntry><div class=MIndex><a href="Functions.html">Functions</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="Properties">Properties</option></select></div></div><!--Menu-->
+--></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-->
<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>
View
@@ -0,0 +1,33 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
+
+<html><head><title>Function Index</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="IndexPage" 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=Index><div class=IPageTitle>Function 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=IOnlySymbolPrefix>&nbsp;</td><td class=IEntry><a href="../files/jquery-ba-hashchange-js.html#jQuery.fn.hashchange" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')" class=ISymbol>hashchange</a>, <span class=IParent>jQuery.fn</span></td></tr></table>
+<!--START_ND_TOOLTIPS-->
+<div class=CToolTip id="tt1"><div class=CFunction>Bind a handler to the window.onhashchange event or trigger all bound window.onhashchange event handlers. </div></div><!--END_ND_TOOLTIPS-->
+
+</div><!--Index-->
+
+
+<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><a href="../files/jquery-ba-hashchange-js.html">jQuery hashchange event</a></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="General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="Events.html">Events</a></div></div><div class=MEntry><div class=MIndex><a href="Files.html">Files</a></div></div><div class=MEntry><div class=MIndex><a href="Properties.html">Properties</a></div></div><div class=MEntry><div class=MIndex id=MSelected>Functions</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-->
+
+
+<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>
Oops, something went wrong.

0 comments on commit 20265f9

Please sign in to comment.