Skip to content

Commit

Permalink
Merge branch 'fix-trailing-hash'
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Apr 2, 2015
2 parents 94d1911 + ad02f0a commit 65c4f34
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion jquery.pjax.js
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ function pjax(options) {
}

var url = parseURL(settings.url)
url.hash = hash
if (hash) url.hash = hash
options.requestUrl = stripInternalParams(url.href)
}

Expand Down
6 changes: 4 additions & 2 deletions test/unit/pjax.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ if ($.support.pjax) {
})
})

asyncTest("GET data is appended to query string", 5, function() {
asyncTest("GET data is appended to query string", 6, function() {
var data = { foo: 1, bar: 2 }

navigate(this.frame)
Expand All @@ -226,10 +226,11 @@ if ($.support.pjax) {
// URL is set immediately
equal(frame.location.pathname, "/env.html")
equal(frame.location.search, "?foo=1&bar=2")
equal(frame.location.href.indexOf("#"), -1)
}, 0)
})

asyncTest("GET data is merged into query string", 5, function() {
asyncTest("GET data is merged into query string", 6, function() {
var data = { bar: 2 }

navigate(this.frame)
Expand All @@ -250,6 +251,7 @@ if ($.support.pjax) {
// URL is set immediately
equal(frame.location.pathname, "/env.html")
equal(frame.location.search, "?foo=1&bar=2")
equal(frame.location.href.indexOf("#"), -1)
}, 0)
})

Expand Down
2 changes: 1 addition & 1 deletion test/unit/pjax_fallback.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ asyncTest("scrolls to anchor at top page"+s, function() {

if (disabled) {
equal(frame.location.pathname, "/home.html")
equal(frame.location.hash, "")
equal(frame.location.href.indexOf("#"), -1)
} else {
equal(frame.location.pathname, "/anchor.html")
equal(frame.location.hash, "#top")
Expand Down

0 comments on commit 65c4f34

Please sign in to comment.