Skip to content

Commit

Permalink
Merge branch 'master' of github.com:asual/jquery-address
Browse files Browse the repository at this point in the history
  • Loading branch information
asual committed Aug 20, 2012
2 parents 961a6e1 + 8cea93a commit 4f0964f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/jquery.address.js
Expand Up @@ -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();
Expand Down Expand Up @@ -122,7 +122,7 @@
},
_html = function() {
var src = _js() + ':' + FALSE + ';document.open();document.writeln(\'<html><head><title>' +
_d.title.replace(/\'/g, '\\\'') + '</title><script>var ' + ID + ' = "' + _href() +
_d.title.replace(/\'/g, '\\\'') + '</title><script>var ' + ID + ' = "' + encodeURIComponent(_href()).replace(/\'/g, '\\\'') +
(_d.domain != _l.hostname ? '";document.domain="' + _d.domain : '') +
'";</' + 'script></head></html>\');document.close();';
if (_version < 7) {
Expand Down Expand Up @@ -248,7 +248,7 @@
_st(fn, delay);
},
_popstate = function() {
if (_value != _href()) {
if (decodeURI(_value) != decodeURI(_href())) {
_value = _href();
_update(FALSE);
}
Expand Down
16 changes: 16 additions & 0 deletions test/test.js
Expand Up @@ -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);
Expand Down

0 comments on commit 4f0964f

Please sign in to comment.