Skip to content

Instantly share code, notes, and snippets.

@gsscoder
Created January 24, 2013 17:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gsscoder/4625249 to your computer and use it in GitHub Desktop.
Save gsscoder/4625249 to your computer and use it in GitHub Desktop.
Simple MLState Opa Calculator.
function sum()
{
a = Int.of_string(Dom.get_value(#vala));
b = Int.of_string(Dom.get_value(#valb));
#res = a + b;
}
function start() {
<div>EasyCalc</div>
<div>
<input id=#vala type="text"/> + <input id=#valb type="text"/>
= <p id=#res/>
<input type="button" value="Add" onclick={function(_) { sum()}}/>
</div>
}
Server.start(
Server.http,
[ {title: "Hello World", page:start} ]
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment