Created
July 21, 2011 02:24
-
-
Save ryancrum/1096382 to your computer and use it in GitHub Desktop.
How to use jQuery from ClojureScript
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns jquerytest.core) | |
(def jquery (js* "$")) | |
(jquery | |
(fn [] | |
(-> (jquery "div.meat") | |
(.html "This is a test.") | |
(.append "<div>Look here!</div>")))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<script type="text/javascript" src="out/goog/base.js"></script> | |
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
<script type="text/javascript" src="jquerytest.js"></script> | |
<script type="text/javascript"> | |
goog.require("jquerytest.core"); | |
</script> | |
</head> | |
<body> | |
<div class="meat">Replace me, jquery.</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment