| Index: native_client_sdk/src/examples/hello_world_interactive/example.js
|
| diff --git a/native_client_sdk/src/examples/hello_world_interactive/example.js b/native_client_sdk/src/examples/hello_world_interactive/example.js
|
| index 9e2a88f99b266ad6cecf46eaefb9ab7f8ca08119..7058f732f58b2e0503ef815731dd926c1bf14b83 100644
|
| --- a/native_client_sdk/src/examples/hello_world_interactive/example.js
|
| +++ b/native_client_sdk/src/examples/hello_world_interactive/example.js
|
| @@ -25,7 +25,12 @@ function reverseText() {
|
| common.naclModule.postMessage('reverseText:' + inputBox.value);
|
| }
|
|
|
| -// Called by the common.js module.
|
| -function handleMessage(message_event) {
|
| - alert(message_event.data);
|
| +function handleMessage(e) {
|
| + if (typeof e.data === 'string') {
|
| + // Received a reversed message.
|
| + common.logMessage('Received "' + e.data + '"\n');
|
| + } else if (typeof e.data === 'number') {
|
| + // Recived 42.
|
| + common.logMessage('Received "' + e.data + '"\n');
|
| + }
|
| }
|
|
|