Comments (2)
The default behaviour of Davis is to bind to all links and forms. If you had some links, or forms, on you page that you don't want Davis to bind to you can ignore them by changing the selector that Davis uses to find links etc.
Depending on your app you could either explicitly mark all the links you want Davis to bind to with a class or data attribute, or you could do so the other way round, explicitly marking all links you don't want Davis to bind to with a class or data attribute.
var app = Davis(function () {
// your routes etc here
this.configure(function () {
this.linkSelector = 'a:not(.external)' // if you want to explicitly mark external links
this.linkSelector = 'a[data-davis=true]' // if you want to explicitly mark davis links
})
})
This will make davis only listen to links that match those selectors, obviously you should choose whichever makes most sense for your app.
I have been working on allowing davis to be used without jQuery, this is currently not released but I can push the dev branch if you want to try it out. It should be possible to swap jQuery with Zepto with no changes required, if you want to use something different or no library at all then you will have to implement a few of the methods from jQuery or zepto that Davis relies on.
from davis.js.
This was helpful. It would be nice to have it more front and center in the documentation. 👍
from davis.js.
Related Issues (20)
- POST routes defined within a scope don't work HOT 3
- Problem with getting hash routing to work HOT 6
- NodeJS / Express Server side Example?
- route matching not working in Firefox when JetBrains Add-on is isntalled
- request.isForPageLoad having issue while coming back to original server rendered url HOT 1
- AMD/UMD support HOT 2
- Route not found causes davis to stop HOT 1
- Redirection w/e req
- Combine hash routes with push state on single application
- Not supported Actively? HOT 7
- Cannot navigate within routes and manually to update URL
- [enhancement] Add missing bower.json. HOT 1
- How to refresh a page without doing a full window reload
- Semicolon delimited query parameters after the path causes route not to match
- davisjs.com gone HOT 2
- Does not properly handle not found routes with a target _blank attribute
- routeCollection is empty
- Davis Router is not working FirefoxOS HOT 1
- Problem with # routing in Davis Js HOT 1
- License Text
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from davis.js.