Comments (8)
Hi,
You need to tell it what you want to listen to:
(listen! (domina/by-id "my-button") :click (js/alert "Woohoo"))
from domina.
js/document is the something in this scenario. It's cool, though. I ended up writing my own dom manipulation/even library. Thanks for the inspiration.
from domina.
@dubiousdavid so what was the problem with the above code?
from domina.
Sorry, not sure what you're referring to. My code or the code posted by fwaddle?
from domina.
My bad, I was referring to your code: is the current implementation of listen!
causing the problem or is it the way you use listen!
?
from domina.
js/document should be a valid listen target, should it not? You can do this in jQuery, and it works as expected.
from domina.
I'm know very little about jquery and therefore not sure what you're trying to do but when attempting to listen you need to get the element itself like so:
(ev/listen! (.-getElementById js/document) :click (js/alert "Hellllo"))
Anyway is your own dom manipulation library open source or available?
from domina.
My goal is to open-source a bunch of cljs libraries (browser and node.js based) I've been developing for the company I work for. I need to run it past my boss, but I would really like to share with the community, especially since much of the work is inspired by existing projects like domina.
David
On Apr 21, 2013, at 9:53 PM, fwaddle [email protected] wrote:
I'm know very little about jquery and therefore not sure what you're trying to do but when attempting to listen you need to get the element itself like so:
(ev/listen! (.-getElementById js/document) :click (js/alert "Hellllo"))
Anyway is your own dom manipulation library open source or available?
—
Reply to this email directly or view it on GitHub.
from domina.
Related Issues (20)
- It should be possible to listen on a node that also happens to have child nodes. HOT 4
- touch event information
- (value) function returns null for <select><option>...</option></select> HOT 2
- Including Domina 1.0.0 in project.clj blocks some closure library access HOT 1
- events/listen! does not work with :optimizations :advanced (??) HOT 11
- Need to remove a 'y' in the readme.
- set-html! and event listeners HOT 1
- get-data/set-data! don't seem to work with "normal" data attributes HOT 5
- Bug in 'array-like?' that messes up selection of 'form' elements. HOT 1
- set-value! and value functions do not work as expected for checkboxes
- Some events don't work when specified as symbols
- domina 1.0.1 jar duplicate files HOT 7
- Clone already referenced & No XPathResult namespace HOT 7
- domina/nodes always returns an empty collection in :optimizations :simple
- Is there a way to avoid side effects when parsing html strings? HOT 2
- Move to a multi segment namespace HOT 3
- Key Codes not working properly on key events
- Issue selecting styles
- How to get around/fix/avoid annoying message about single segment namespace? HOT 1
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 domina.