Sorry if this is something trivial. I tried to do some due diligence
googling with no luck.
The function getElementById seems to be returning null where it shouldn't.
I'm currently using
lein-cljsbuild 1.1.2
clojure 1.7.0
clojurescript 1.7.170
and compiling with optimizations: :none
Here's my HTML:
<!DOCTYPE html>
<html>
<head>
<script src="js/main.js"></script>
</head>
<body>
<div id="test-content">Test text</div>
</body>
</html>
Here's my Clojurescript:
(ns gol-cljs.core)
(.log js/console (. js/document getElementById "test-content"))
This prints "null" to Chrome's browser console.
Attempting any operations on (. js/document getElementById "test-content"))
gives errors about trying to do things with "null".
Is there some requirement I'm missing for accessing the dom?
Best,
Nathan
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.