Now we can run javascript and send back the return values

This commit is contained in:
Jonatan Pålsson 2011-01-25 14:27:04 +01:00
parent c88dcf7829
commit b1a65ef0ac
8 changed files with 10 additions and 3 deletions

View file

@ -1,7 +1,11 @@
-module(js_runner).
-export([run/0]).
-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">>, [<<"Generic Game Server">>]).
js:call(Port, <<"helloworld">>, [Data]).