Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #140 from kycook/master

Fix for single quote character in parameter triggering external change
  • Loading branch information...
commit 8cea93a075e903a2a6bfe7fd3f73e75be63a9f79 2 parents c1a4b3e + af3dfd0
@asual authored
Showing with 18 additions and 2 deletions.
  1. +2 −2 src/jquery.address.js
  2. +16 −0 test/test.js
View
4 src/jquery.address.js
@@ -84,7 +84,7 @@
_listen = function() {
if (!_silent) {
var hash = _href(),
- diff = _value != hash;
+ diff = decodeURI(_value) != decodeURI(hash);
if (diff) {
if (_msie && _version < 7) {
_l.reload();
@@ -248,7 +248,7 @@
_st(fn, delay);
},
_popstate = function() {
- if (_value != _href()) {
+ if (decodeURI(_value) != decodeURI(_href())) {
_value = _href();
_update(FALSE);
}
View
16 test/test.js
@@ -243,6 +243,22 @@ asyncTest('Character test', function() {
}, 1000);
});
+asyncTest('Single quote test', function() {
+ setTimeout(function() {
+ var externalChange = 0;
+ var testFunction = function() {
+ externalChange++;
+ equals(externalChange, 0);
+ };
+ var ignore = false;
+ $.address.value('/')
+ .bind('externalChange', testFunction)
+ .parameter('p', "Patrick's Test")
+ .unbind('externalChange', testFunction);
+ start();
+ }, 1000);
+});
+
asyncTest('Value test', function() {
setTimeout(function() {
$.address.value(1);
Please sign in to comment.
Something went wrong with that request. Please try again.