Created
January 25, 2011 15:54
-
-
Save jonte/795103 to your computer and use it in GitHub Desktop.
js_runner
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
-module(js_runner). | |
-export([executeJS/2, boot/0]). | |
boot() -> | |
erlang_js:start(), | |
{ok, Port} = js_driver:new(), | |
Port. | |
executeJS(Port, Data) -> | |
ok = js:define(Port, <<"function helloworld(name){return 'Hello, ' + name}">>), | |
js:call(Port, <<"helloworld">>, [list_to_binary(Data)]). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment