3 ms·
Not quite. The following shows what doesn't work: (def $ js/jQuery) (.each ($ "body") (fn [idx, val] (.write js/document "In a
by bjourne 14y ago
Not quite. The following shows what doesn't work:
(def $ js/jQuery)
(.each ($ "body") (fn [idx, val]
(.write js/document "In a lambda")))
The Google Closure Compiler munges names of functions so that any function declared in ClojureScript cannot be called from jQuery which means that no jQuery function that takes a callback can be used. And you really want to use GCC because without its dead code removal a simple helloworld.js file takes more than 700kb.
- swannodette 14y agoYou just need to compile your ClojureScript with the popular jQuery externs file.
- jwhitlark 14y agoYou can mark things so that their names aren't mudged via ^:export.