imcplugin demo: Extend to support stat() call
[nativeclient.git] / tests / life / life.html
blob30d57d069ea951bf8d04fdd8d8c81d9fafe4d5e1
1 <HTML>
2 <HEAD>
3 <TITLE>Life Demo</TITLE>
5 <script type="text/javascript">
7 var nacl_elt;
9 // Before scripting the loaded module, ensure the Native Client module is loaded.
10 var startupTimeout;
12 var PostLoadInit = function() {
13 if (nacl_elt.__moduleReady == 1) {
14 clearTimeout(startupTimeout);
15 nacl_elt.focus();
16 } else {
17 if (nacl_elt.__moduleReady == undefined) {
18 alert('The Native Client plugin was unable to load');
19 return;
21 startupTimeout = setTimeout(PostLoadInit, 100);
25 // Init is called when the document has completed loading. It downloads the
26 // NativeClient modules.
27 var Init = function() {
28 // service_url contains the location of the NativeClient module to be
29 // loaded as a service.
30 nacl_elt = document.getElementById('embed1');
31 PostLoadInit();
35 </script>
37 </HEAD>
38 <BODY id="bodyId" onload="Init();" >
40 <h1>Conway's Life</h1>
41 <p>
42 Use the mouse to paint extra life into the simulation.
43 </p>
44 <embed id="embed1" src="life.nexe" type="application/x-nacl-srpc" width=512 height=512>
45 <br>
47 <script>
48 var embed1 = document.getElementById('embed1');
49 </script>
52 </BODY>
53 </HTML>