Index: native_client_sdk/src/examples/api/vpn_provider/example.js |
diff --git a/native_client_sdk/src/getting_started/part2/example.js b/native_client_sdk/src/examples/api/vpn_provider/example.js |
similarity index 70% |
copy from native_client_sdk/src/getting_started/part2/example.js |
copy to native_client_sdk/src/examples/api/vpn_provider/example.js |
index 7a392a2c6287b101760ea540a01a9d8600dfece0..fb405b27d0cf6055fa4796c566fdd74025c4b3a9 100644 |
--- a/native_client_sdk/src/getting_started/part2/example.js |
+++ b/native_client_sdk/src/examples/api/vpn_provider/example.js |
@@ -13,7 +13,20 @@ function moduleDidLoad() { |
// NaCl module's <embed> element. |
// |
// postMessage sends a message to it. |
+ // common.naclModule.postMessage('hello'); |
+} |
+ |
+function load_me() { |
common.naclModule.postMessage('hello'); |
+ |
+ document.getElementById("load").disabled = true; |
+ document.getElementById("unload").disabled = false; |
+} |
+function unload_me() { |
+ common.naclModule.postMessage('bye'); |
+ |
+ document.getElementById("load").disabled = false; |
+ document.getElementById("unload").disabled = true; |
} |
// This function is called by common.js when a message is received from the |