2012-04-12 22:21:50 +02:00
|
|
|
<html>
|
|
|
|
<head>
|
|
|
|
<title>Binding Test</title>
|
|
|
|
<script language="JavaScript">
|
|
|
|
|
|
|
|
// Register the callback for messages from the browser process.
|
|
|
|
app.setMessageCallback('binding_test', function(name, args) {
|
|
|
|
document.getElementById('result').value = "Response: "+args[0];
|
|
|
|
});
|
|
|
|
|
|
|
|
// Send a message to the browser process.
|
|
|
|
function sendMessage() {
|
|
|
|
var msg = document.getElementById("message").value;
|
|
|
|
app.sendMessage('binding_test', [msg]);
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
</head>
|
2013-09-03 23:58:02 +02:00
|
|
|
<body bgcolor="white">
|
2012-04-12 22:21:50 +02:00
|
|
|
<form>
|
|
|
|
Message: <input type="text" id="message" value="My Message">
|
|
|
|
<br/><input type="button" onclick="sendMessage();" value="Send Message">
|
|
|
|
<br/>You should see the reverse of your message below:
|
|
|
|
<br/><textarea rows="10" cols="40" id="result"></textarea>
|
|
|
|
</form>
|
|
|
|
</body>
|
|
|
|
</html>
|