Created
August 5, 2011 16:17
-
-
Save fogus/1127895 to your computer and use it in GitHub Desktop.
using an external lib in clojurescript
This file contains hidden or 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
| # from your project directory | |
| cljsc src {:optimizations :advanced} > hello.js | |
| open hello.html |
This file contains hidden or 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
| function foo() { | |
| alert('you called foo!'); | |
| }; | |
This file contains hidden or 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
| ;; located in <project>/src/hello/core.cljs | |
| (ns hello.core) | |
| (js/foo) |
This file contains hidden or 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> | |
| <title>Hello ClojureScript</title> | |
| </head> | |
| <body> | |
| <h1>Hello ClojureScript!</h1> | |
| <script type="text/javascript" src="foo.js"></script> | |
| <script type="text/javascript" src="hello.js"></script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment