Comments (5)
Can you post the code that returns nill on .-innerHTML? That seems like something is wrong. That is how I do it in enfocus tests. You might need to pull the nodes out before you can call innerHTML.
from enfocus.
Thanks for your reply. deftemplate definition is
(em/deftemplate test-template :compiled "resources/tpl/jsnippet/users.html"
[]
)
this transforms below can get the html which return by (test-template)
invoke,
dess.users> (ef/at "#wrapper" (ef/content (test-template)))
<div id="wrapper">
<div id="dropdown-list">
<div role="group" class="btn-group">
<button aria-expanded="false" aria-haspopup="true" data-toggle="dropdown" class="btn btn-xs btn-warning dropdown-toggle" type="button">
handler
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li><a rel="1" href="#">action1</a></li>
</ul>
</div>
</div>
</div>
and (test-template)
can return #object[DocumentFragment [object DocumentFragment]]
howerver, (.-innerHTML (test-template)
return nil.
I am not sure whether need some other info , please just comment.
from enfocus.
What browser are you using? Also try this and let me know what you get.
(apply str (for [node (test-template)] (.-innerHTML node))
from enfocus.
I have tried for firefox (40.0.3) and opera (Opera 31.0) on linux.
for opera:
(apply str (for [node (test-template)] (.-innerHTML node)))
#object[Error Error: [object DocumentFragment] is not ISeqable]
Error: [object DocumentFragment] is not ISeqable
at Error (native)
at cljs.core.seq (http://wc.local/admin/js/admin-main-debug.js:5941:69)
at cljs.core.pr_str.call.cljs.core.apply.call.iter__21561__auto__ (eval at <anonymous> (http://wc.local/admin/js/admin-main-debug.js:28426:264), <anonymous>:5:40)
at cljs.core.LazySeq.sval (http://wc.local/admin/js/admin-main-debug.js:9071:122)
at cljs.core.LazySeq.cljs$core$ISeqable$_seq$arity$1 (http://wc.local/admin/js/admin-main-debug.js:9106:8)
at Object.cljs.core.seq (http://wc.local/admin/js/admin-main-debug.js:5933:14)
at Object.cljs.core.bounded_count (http://wc.local/admin/js/admin-main-debug.js:9523:28)
at Function.cljs.core.apply.cljs$core$IFn$_invoke$arity$2 (http://wc.local/admin/js/admin-main-debug.js:9895:23)
at cljs.core.apply (http://wc.local/admin/js/admin-main-debug.js:9881:30)
at eval (eval at <anonymous> (http://wc.local/admin/js/admin-main-debug.js:28426:264), <anonymous>:1:106)
for firefox:
(apply str (for [node (test-template)] (.-innerHTML node)))
#object[Error Error: [object DocumentFragment] is not ISeqable]
No stacktrace available.
It seems give no more other info. Besides, I used :optimizations :simple
for :compiler
, I am not sure whether this has influence , thanks.
from enfocus.
addition:
I noticed your function that definded in enfocus.core-test
(defn by-id [id]
(.getElementById js/document id))
(by-id "wrapper")
return #object[HTMLDivElement [object HTMLDivElement]]
, and call (.-innerHTML (by-id "wrapper"))
will return :
"\n <!-- Navigation -->\n <nav class=\"navbar navbar-default navbar-static-top\" role=\"navigation\" style=\"margin-bottom: 0\">\n <div class=\"navbar-header\">\n <button class=\"navbar-toggle\" data-target=\".navbar-collapse\" data-toggle=\"collapse\" type=\"button\">\n <span class=\"sr-only\">Toggle navigation</span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n <span class=\"icon-bar\"></span>\n </button>\n
....
this string is excatly i want. Maybe #object[HTMLDivElement [object HTMLDivElement]]
and #object[DocumentFragment [object DocumentFragment]]
is the point ?
from enfocus.
Related Issues (20)
- Need escape content in ef/content or make other function that do correct html escaping.
- event handler functions within hiccup-html HOT 2
- replace-vars broken in clojurescript 1.7.145 HOT 6
- Great project
- Extractor extract node HOT 1
- Clone-for and lists HOT 15
- Hiccup input control - checked and disabled not working HOT 2
- Requiring enfocus.macros under Clojure 1.10 and above triggers an error
- compiling fails at target/cljsbuild-compiler-0/enfocus/core.cljs HOT 4
- get-prop doesn't work on data attributes HOT 1
- listen-live looses event information HOT 6
- Multiple Extractions HOT 5
- Add optional callback for when view-binding function completed HOT 6
- debug should be set to false by default HOT 4
- (read-form) on IE8 results in [object]is not ISeqable HOT 7
- How can I use holder.js in html snippet? HOT 4
- Difference in ef/content behaviour HOT 2
- clone-for issue "TypeError: enfocus.core.last_element_child is undefined" HOT 1
- Function based inline snippets HOT 3
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 enfocus.