Closed agildehaus closed 12 years ago
Thanks for reporting this. Just to confirm, this was not present in version 0.9.0? It looks like I introduced a regression in the latest version, I'll take a look.
I believe the problem was present in 0.9.0.
I am also having this issue in 0.8.1
It stems from this code
delegateToServer: function () {
window.location.pathname = self.attr('href')
},
It works if you use
window.location= self.attr('href')
I have also added some code like originCheck named targetCheck that for A checks the target attribute, if its not null (i.e. _blank) it exits and lets the browser handle it. I was finding it was not opening in a new tab.
var targetChecks = {
A: function (elem) {
return elem.target != null && elem.target != '' && typeof(elem.target) != 'undefined';
}
}
var differentTarget = function (elem) {
if (!targetChecks[elem.nodeName.toUpperCase()]) return true // the elem is neither a link or a form
return targetChecks[elem.nodeName.toUpperCase()](elem)
}
Thanks for reporting this, I have pushed a new version (0.9.3) which includes a fix for this issue
In 0.9.5 there is no fix for this?
https://github.com/olivernn/davis.js/blob/v0.9.5/lib/davis.listener.js
Because i'm getting no route found
for routes with ?params
, but the same route without ?params
works fine.
This affects the latest version, 0.9.1.
A simple page showing this issue can be found here: http://goo.gl/42KGV
If I have a link with no matching route, usually it works well ... until I found that this doesn't work when the link has a query string attached.
a href="/blah.html?foo=bar"
will cause Davis to direct the browser to "/blah.html%3Ffoo=bar?foo=bar" instead of "/blah.html?foo=bar".