OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title><ProjectName>!</title> | 4 <title><ProjectName>!</title> |
5 | 5 |
6 <script type="text/javascript"> | 6 <script type="text/javascript"> |
7 <ProjectName>Module = null; // Global application object. | 7 <ProjectName>Module = null; // Global application object. |
8 statusText = 'NO-STATUS'; | 8 statusText = 'NO-STATUS'; |
9 | 9 |
10 // Indicate load success. | 10 // Indicate load success. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 <p> | 57 <p> |
58 <!-- Load the published .nexe. This includes the 'nacl' attribute which | 58 <!-- Load the published .nexe. This includes the 'nacl' attribute which |
59 shows how to load multi-architecture modules. Each entry in the "nexes" | 59 shows how to load multi-architecture modules. Each entry in the "nexes" |
60 object in the .nmf manifest file is a key-value pair: the key is the | 60 object in the .nmf manifest file is a key-value pair: the key is the |
61 instruction set architecture ('x86-32', 'x86-64', etc.); the value is a URL | 61 instruction set architecture ('x86-32', 'x86-64', etc.); the value is a URL |
62 for the desired NaCl module. | 62 for the desired NaCl module. |
63 To load the debug versions of your .nexes, set the 'nacl' attribute to the | 63 To load the debug versions of your .nexes, set the 'nacl' attribute to the |
64 _dbg.nmf version of the manifest file. | 64 _dbg.nmf version of the manifest file. |
65 | 65 |
66 Note: Since this NaCl module does not use any real-estate in the browser, | 66 Note: Since this NaCl module does not use any real-estate in the browser, |
67 it's width and height are set to 0. | 67 its width and height are set to 0. |
68 | 68 |
69 Note: The <EMBED> element is wrapped inside a <DIV>, which has both a 'load' | 69 Note: The <EMBED> element is wrapped inside a <DIV>, which has both a 'load' |
70 and a 'message' event listener attached. This wrapping method is used | 70 and a 'message' event listener attached. This wrapping method is used |
71 instead of attaching the event listeners directly to the <EMBED> element to | 71 instead of attaching the event listeners directly to the <EMBED> element to |
72 ensure that the listeners are active before the NaCl module 'load' event | 72 ensure that the listeners are active before the NaCl module 'load' event |
73 fires. This also allows you to use PPB_Messaging.PostMessage() (in C) or | 73 fires. This also allows you to use PPB_Messaging.PostMessage() (in C) or |
74 pp::Instance.PostMessage() (in C++) from within the initialization code in | 74 pp::Instance.PostMessage() (in C++) from within the initialization code in |
75 your NaCl module. | 75 your NaCl module. |
76 --> | 76 --> |
77 <div id="listener"> | 77 <div id="listener"> |
78 <script type="text/javascript"> | 78 <script type="text/javascript"> |
79 var listener = document.getElementById('listener'); | 79 var listener = document.getElementById('listener'); |
80 listener.addEventListener('load', moduleDidLoad, true); | 80 listener.addEventListener('load', moduleDidLoad, true); |
81 listener.addEventListener('message', handleMessage, true); | 81 listener.addEventListener('message', handleMessage, true); |
82 </script> | 82 </script> |
83 | 83 |
84 <embed name="nacl_module" | 84 <embed name="nacl_module" |
85 id="<PROJECT_NAME>" | 85 id="<PROJECT_NAME>" |
86 width=0 height=0 | 86 width=0 height=0 |
87 src="<PROJECT_NAME>.nmf" | 87 src="<PROJECT_NAME>.nmf" |
88 type="application/x-nacl" /> | 88 type="application/x-nacl" /> |
89 </div> | 89 </div> |
90 </p> | 90 </p> |
91 | 91 |
92 <h2>Status</h2> | 92 <h2>Status</h2> |
93 <div id="status_field">NO-STATUS</div> | 93 <div id="status_field">NO-STATUS</div> |
94 </body> | 94 </body> |
95 </html> | 95 </html> |
OLD | NEW |