cef/tests/cefclient/res/binding.html
Marshall Greenblatt 647c74cf96 Add JavaScript binding example to cefclient.
git-svn-id: https://chromiumembedded.googlecode.com/svn/trunk@590 5089003a-bbd8-11dd-ad1f-f1f9622dbc98
2012-04-12 20:21:50 +00:00

28 lines
741 B
HTML

<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>
<body>
<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>