Skip to content

Instantly share code, notes, and snippets.

@diorahman
Created August 6, 2013 22:58
Show Gist options
  • Select an option

  • Save diorahman/6169585 to your computer and use it in GitHub Desktop.

Select an option

Save diorahman/6169585 to your computer and use it in GitHub Desktop.
javascript call vala from index.html
<!doctype html>
<html>
<head>
<title>Hello</title>
</head>
<body>
<div>
<input id="input" value="Kismis">
<button id="button">Greet!</button>
</div>
<div>
Hello <span id="name"></span>
</div>
<script type="text/javascript">
var app = new App();
document.getElementById('button').onclick = function(){
var creature = { name : document.getElementById('input').value};
app.hello(creature, function(err, greet){
var name = document.getElementById('name');
name.innerText = greet.name;
})
}
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment