Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jquery 1.11.1 fix #44

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
10 changes: 5 additions & 5 deletions README.markdown
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# jQuery hashchange event #
[http://benalman.com/projects/jquery-hashchange-plugin/](http://benalman.com/projects/jquery-hashchange-plugin/)

Version: 1.3, Last updated: 7/21/2010
Version: 1.4, Last updated: 5/29/2014 [$.browser support for jQuery 1.9+](https://github.com/sapzxc/jquery-hashchange/)

This jQuery plugin enables very basic bookmarkable #hash history via a cross-browser window.onhashchange event.

Expand All @@ -25,14 +25,13 @@ tested with, what browsers it has been tested in, and where the unit tests
reside (so you can test it yourself).

### jQuery Versions ###
1.2.6, 1.3.2, 1.4.1, 1.4.2
1.2.6, 1.3.2, 1.4.1, 1.4.2, 1.11.1, 2.1.1

### Browsers Tested ###
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.
Internet Explorer 6-11, Firefox 2-32, Chrome 5-38, Safari 3.2-7.1, Opera 9.6-10.60, iPhone 3.1, Android 1.6-2.2, BlackBerry 4.6-5.

### Unit Tests ###
[http://benalman.com/code/projects/jquery-hashchange/unit/](http://benalman.com/code/projects/jquery-hashchange/unit/)

<s>[http://benalman.com/code/projects/jquery-hashchange/unit/](http://benalman.com/code/projects/jquery-hashchange/unit/)</s> - not supported by repository owner. Clone this repo and open unit/index.html in your browser.

## A more robust solution ##

Expand Down Expand Up @@ -61,6 +60,7 @@ event, but not report that it does, the fallback polling loop will be used.

## Release History ##

1.4 - (5/29/2014) Changed $.browser.msie to regular expression.
1.3 - (7/21/2010) Reorganized IE6/7 Iframe code to make it more "removable" for mobile-only development. Added IE6/7 document.title support. Attempted 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 provides for built-in events. Renamed jQuery.hashchangeDelay to jQuery.fn.hashchange.delay and lowered its default value to 50. Added jQuery.fn.hashchange.domain and jQuery.fn.hashchange.src properties plus document-domain.html file to address access denied issues when setting document.domain in IE6/7.
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.
Expand Down
20 changes: 20 additions & 0 deletions bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "jquery-hashchange",
"description": "This jQuery (v1.9+) plugin enables very basic bookmarkable #hash history via a cross-browser HTML5 window.onhashchange event.",
"version": "1.4",
"main": "jquery.ba-hashchange.js",
"keywords": ["hashchange", "bookmark", "history"],
"repository": {
"type": "git",
"url": "git://github.com/sapzxc/jquery-hashchange.git"
},
"dependencies": {
"jquery": "1.11.1"
},
"ignore": [
"unit",
"shared",
"examples",
"docs"
]
}
12 changes: 7 additions & 5 deletions jquery.ba-hashchange.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/*!
* jQuery hashchange event - v1.3 - 7/21/2010
* jQuery hashchange event - v1.4 - 5/29/2014
* http://benalman.com/projects/jquery-hashchange-plugin/
*
* Copyright (c) 2010 "Cowboy" Ben Alman
* Dual licensed under the MIT and GPL licenses.
* http://benalman.com/about/license/
* @license http://benalman.com/about/license/
*/

// Script: jQuery hashchange event
//
// *Version: 1.3, Last updated: 7/21/2010*
// *Version: 1.4, Last updated: 5/29/2014*
//
// Project Home - http://benalman.com/projects/jquery-hashchange-plugin/
// GitHub - http://github.com/cowboy/jquery-hashchange/
Expand All @@ -36,7 +36,7 @@
// tested with, what browsers it has been tested in, and where the unit tests
// reside (so you can test it yourself).
//
// jQuery Versions - 1.2.6, 1.3.2, 1.4.1, 1.4.2
// jQuery Versions - 1.2.6, 1.3.2, 1.4.1, 1.4.2, 1.11.1
// Browsers Tested - 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.
// Unit Tests - http://benalman.com/code/projects/jquery-hashchange/unit/
Expand All @@ -58,6 +58,7 @@
// event, but not report that it does, the fallback polling loop will be used.
//
// About: Release History
// 1.4 - (5/29/2014) Changed $.browser.msie to regular expression.
//
// 1.3 - (7/21/2010) Reorganized IE6/7 Iframe code to make it more
// "removable" for mobile-only development. Added IE6/7 document.title
Expand Down Expand Up @@ -297,7 +298,8 @@
// vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
// vvvvvvvvvvvvvvvvvvv REMOVE IF NOT SUPPORTING IE6/7/8 vvvvvvvvvvvvvvvvvvv
// vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
$.browser.msie && !supports_onhashchange && (function(){
/msie/.test(navigator.userAgent.toLowerCase()) &&
!supports_onhashchange && (function(){
// Not only do IE6/7 need the "magical" Iframe treatment, but so does IE8
// when running in "IE7 compatibility" mode.

Expand Down
8 changes: 4 additions & 4 deletions jquery.ba-hashchange.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions shared/jquery-1.11.1.js

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions shared/jquery-2.1.1.js

Large diffs are not rendered by default.

10 changes: 6 additions & 4 deletions unit/document-domain.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,12 @@ <h2 id="qunit-banner"><span></span></h2>
<h2 id="qunit-userAgent"></h2>
<p>
<i>These unit tests include jQuery <span id="jq_version">...</span>.</i>
<br>To view the unit tests using jQuery 1.4.2, <a href="./">click here</a>.
<br>To view the unit tests using jQuery 1.4.1, <a href="./jquery-1.4.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.3.2, <a href="./jquery-1.3.2.html">click here</a>.
<br>To view the unit tests using jQuery 1.2.6, <a href="./jquery-1.2.6.html">click here</a>.
<br>To view the unit tests using jQuery 2.1.1, <a href="./jquery-2.1.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.11.1, <a href="./jquery-1.11.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.4.2, <a href="./jquery-1.4.2.html">click here</a>.
<br>To view the unit tests using jQuery 1.4.1, <a href="./jquery-1.4.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.3.2, <a href="./jquery-1.3.2.html">click here</a>.
<br>To view the unit tests using jQuery 1.2.6, <a href="./jquery-1.2.6.html">click here</a>.
<br>To view a unit test page using &lt;meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"&gt; <a href="./ie7-compat.html">click here</a> (IE8).
<br>To view a unit test page using document.domain; <a href="./document-domain.html">click here</a>. <b>(selected)</b>
</p>
Expand Down
10 changes: 6 additions & 4 deletions unit/ie7-compat.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ <h2 id="qunit-banner"><span></span></h2>
<h2 id="qunit-userAgent"></h2>
<p>
<i>These unit tests include jQuery <span id="jq_version">...</span>.</i>
<br>To view the unit tests using jQuery 1.4.2, <a href="./">click here</a>.
<br>To view the unit tests using jQuery 1.4.1, <a href="./jquery-1.4.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.3.2, <a href="./jquery-1.3.2.html">click here</a>.
<br>To view the unit tests using jQuery 1.2.6, <a href="./jquery-1.2.6.html">click here</a>.
<br>To view the unit tests using jQuery 2.1.1, <a href="./jquery-2.1.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.11.1, <a href="./jquery-1.11.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.4.2, <a href="./jquery-1.4.2.html">click here</a>.
<br>To view the unit tests using jQuery 1.4.1, <a href="./jquery-1.4.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.3.2, <a href="./jquery-1.3.2.html">click here</a>.
<br>To view the unit tests using jQuery 1.2.6, <a href="./jquery-1.2.6.html">click here</a>.
<br>To view a unit test page using &lt;meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"&gt; <a href="./ie7-compat.html">click here</a> (IE8). <b>(selected)</b>
<br>To view a unit test page using document.domain; <a href="./document-domain.html">click here</a>.
</p>
Expand Down
31 changes: 4 additions & 27 deletions unit/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,11 @@
<html>
<head>
<title>jQuery hashchange event - Unit Tests</title>
<link rel="stylesheet" href="qunit.css" type="text/css" media="screen">
<script type="text/javascript" src="../shared/qunit.js"></script>

<script type="text/javascript" src="../shared/jquery-1.4.2.js"></script>

<script type="text/javascript" src="../jquery.ba-hashchange.js"></script>
<script type="text/javascript" src="unit.js"></script>
</head>
<body>
<div id="qunit-header">
<h1>jQuery hashchange event - Unit Tests</h1>
<small><a href="http://benalman.com/projects/jquery-hashchange-plugin/">Project Home</a></small>
<div style="clear:both"></div>
</div>
<h2 id="qunit-banner"><span></span></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<p>
<i>These unit tests include jQuery <span id="jq_version">...</span>.</i>
<br>To view the unit tests using jQuery 1.4.2, <a href="./">click here</a>. <b>(selected)</b>
<br>To view the unit tests using jQuery 1.4.1, <a href="./jquery-1.4.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.3.2, <a href="./jquery-1.3.2.html">click here</a>.
<br>To view the unit tests using jQuery 1.2.6, <a href="./jquery-1.2.6.html">click here</a>.
<br>To view a unit test page using &lt;meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"&gt; <a href="./ie7-compat.html">click here</a> (IE8).
<br>To view a unit test page using document.domain; <a href="./document-domain.html">click here</a>.
</p>
<ol id="qunit-tests"></ol>
<h3 id="notice"></h3>
<div style="height:2000px"></div><!-- make sure the page doesn't scroll when the event is first bound -->
Redirecting to latest version...
<script>
window.location = 'jquery-2.1.1.html';
</script>
</body>
</html>
37 changes: 37 additions & 0 deletions unit/jquery-1.11.1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<!DOCTYPE html>
<html>
<head>
<title>jQuery hashchange event - Unit Tests</title>
<link rel="stylesheet" href="qunit.css" type="text/css" media="screen">
<script type="text/javascript" src="../shared/qunit.js"></script>

<script type="text/javascript" src="../shared/jquery-1.11.1.js"></script>

<script type="text/javascript" src="../jquery.ba-hashchange.js"></script>
<script type="text/javascript" src="unit.js"></script>
</head>
<body>
<div id="qunit-header">
<h1>jQuery hashchange event - Unit Tests</h1>
<small><a href="http://benalman.com/projects/jquery-hashchange-plugin/">Project Home</a></small>
<div style="clear:both"></div>
</div>
<h2 id="qunit-banner"><span></span></h2>
<div id="qunit-testrunner-toolbar"></div>
<h2 id="qunit-userAgent"></h2>
<p>
<i>These unit tests include jQuery <span id="jq_version">...</span>.</i>
<br>To view the unit tests using jQuery 2.1.1, <a href="./jquery-2.1.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.11.1, <a href="./jquery-1.11.1.html">click here</a>. <b>(selected)</b>
<br>To view the unit tests using jQuery 1.4.2, <a href="./jquery-1.4.2.html">click here</a>.
<br>To view the unit tests using jQuery 1.4.1, <a href="./jquery-1.4.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.3.2, <a href="./jquery-1.3.2.html">click here</a>.
<br>To view the unit tests using jQuery 1.2.6, <a href="./jquery-1.2.6.html">click here</a>.
<br>To view a unit test page using &lt;meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"&gt; <a href="./ie7-compat.html">click here</a> (IE8).
<br>To view a unit test page using document.domain; <a href="./document-domain.html">click here</a>.
</p>
<ol id="qunit-tests"></ol>
<h3 id="notice"></h3>
<div style="height:2000px"></div><!-- make sure the page doesn't scroll when the event is first bound -->
</body>
</html>
10 changes: 6 additions & 4 deletions unit/jquery-1.2.6.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ <h2 id="qunit-banner"><span></span></h2>
<h2 id="qunit-userAgent"></h2>
<p>
<i>These unit tests include jQuery <span id="jq_version">...</span>.</i>
<br>To view the unit tests using jQuery 1.4.2, <a href="./">click here</a>.
<br>To view the unit tests using jQuery 1.4.1, <a href="./jquery-1.4.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.3.2, <a href="./jquery-1.3.2.html">click here</a>.
<br>To view the unit tests using jQuery 1.2.6, <a href="./jquery-1.2.6.html">click here</a>. <b>(selected)</b>
<br>To view the unit tests using jQuery 2.1.1, <a href="./jquery-2.1.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.11.1, <a href="./jquery-1.11.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.4.2, <a href="./jquery-1.4.2.html">click here</a>.
<br>To view the unit tests using jQuery 1.4.1, <a href="./jquery-1.4.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.3.2, <a href="./jquery-1.3.2.html">click here</a>.
<br>To view the unit tests using jQuery 1.2.6, <a href="./jquery-1.2.6.html">click here</a>. <b>(selected)</b>
<br>To view a unit test page using &lt;meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"&gt; <a href="./ie7-compat.html">click here</a> (IE8).
<br>To view a unit test page using document.domain; <a href="./document-domain.html">click here</a>.
</p>
Expand Down
10 changes: 6 additions & 4 deletions unit/jquery-1.3.2.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ <h2 id="qunit-banner"><span></span></h2>
<h2 id="qunit-userAgent"></h2>
<p>
<i>These unit tests include jQuery <span id="jq_version">...</span>.</i>
<br>To view the unit tests using jQuery 1.4.2, <a href="./">click here</a>.
<br>To view the unit tests using jQuery 1.4.1, <a href="./jquery-1.4.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.3.2, <a href="./jquery-1.3.2.html">click here</a>. <b>(selected)</b>
<br>To view the unit tests using jQuery 1.2.6, <a href="./jquery-1.2.6.html">click here</a>.
<br>To view the unit tests using jQuery 2.1.1, <a href="./jquery-2.1.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.11.1, <a href="./jquery-1.11.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.4.2, <a href="./jquery-1.4.2.html">click here</a>.
<br>To view the unit tests using jQuery 1.4.1, <a href="./jquery-1.4.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.3.2, <a href="./jquery-1.3.2.html">click here</a>. <b>(selected)</b>
<br>To view the unit tests using jQuery 1.2.6, <a href="./jquery-1.2.6.html">click here</a>.
<br>To view a unit test page using &lt;meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"&gt; <a href="./ie7-compat.html">click here</a> (IE8).
<br>To view a unit test page using document.domain; <a href="./document-domain.html">click here</a>.
</p>
Expand Down
10 changes: 6 additions & 4 deletions unit/jquery-1.4.1.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@ <h2 id="qunit-banner"><span></span></h2>
<h2 id="qunit-userAgent"></h2>
<p>
<i>These unit tests include jQuery <span id="jq_version">...</span>.</i>
<br>To view the unit tests using jQuery 1.4.2, <a href="./">click here</a>.
<br>To view the unit tests using jQuery 1.4.1, <a href="./jquery-1.4.1.html">click here</a>. <b>(selected)</b>
<br>To view the unit tests using jQuery 1.3.2, <a href="./jquery-1.3.2.html">click here</a>.
<br>To view the unit tests using jQuery 1.2.6, <a href="./jquery-1.2.6.html">click here</a>.
<br>To view the unit tests using jQuery 2.1.1, <a href="./jquery-2.1.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.11.1, <a href="./jquery-1.11.1.html">click here</a>.
<br>To view the unit tests using jQuery 1.4.2, <a href="./jquery-1.4.2.html">click here</a>.
<br>To view the unit tests using jQuery 1.4.1, <a href="./jquery-1.4.1.html">click here</a>. <b>(selected)</b>
<br>To view the unit tests using jQuery 1.3.2, <a href="./jquery-1.3.2.html">click here</a>.
<br>To view the unit tests using jQuery 1.2.6, <a href="./jquery-1.2.6.html">click here</a>.
<br>To view a unit test page using &lt;meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"&gt; <a href="./ie7-compat.html">click here</a> (IE8).
<br>To view a unit test page using document.domain; <a href="./document-domain.html">click here</a>.
</p>
Expand Down
Loading