OLD | NEW |
---|---|
1 .. _tutorial2: | 1 .. _tutorial2: |
2 | 2 |
3 ###################################### | 3 ###################################### |
4 C++ Tutorial: Getting Started (Part 2) | 4 C++ Tutorial: Getting Started (Part 2) |
5 ###################################### | 5 ###################################### |
6 | 6 |
7 .. contents:: | 7 .. contents:: |
8 :local: | 8 :local: |
9 :backlinks: none | 9 :backlinks: none |
10 :depth: 2 | 10 :depth: 2 |
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
294 <body data-name="part2" | 294 <body data-name="part2" |
295 data-tools="newlib glibc pnacl" | 295 data-tools="newlib glibc pnacl" |
296 data-configs="Debug Release" | 296 data-configs="Debug Release" |
297 data-path="{tc}/{config}"> | 297 data-path="{tc}/{config}"> |
298 ... | 298 ... |
299 | 299 |
300 ``common.js`` will read these data attributes to allow you to load the same | 300 ``common.js`` will read these data attributes to allow you to load the same |
301 example with different toolchains by changing the URL's `query string | 301 example with different toolchains by changing the URL's `query string |
302 <http://en.wikipedia.org/wiki/Query_string>`_. For example, you can load the | 302 <http://en.wikipedia.org/wiki/Query_string>`_. For example, you can load the |
303 glibc Debug version of this example by navigating to | 303 glibc Debug version of this example by navigating to |
304 ``index.html?tc=glibc&config=Debug``. | 304 ``index.html?tc=glibc&config=Debug``. Path URI's such as ``../``, for example |
305 do not work for either the data-path parameter or its corresponding query | |
306 string. | |
JF
2014/09/02 20:57:34
I think this is helpful, but IIUC the confusion fr
| |
305 | 307 |
306 Next, we remove the ``embed`` element that is described in HTML. This will be | 308 Next, we remove the ``embed`` element that is described in HTML. This will be |
307 automatically added for us by ``common.js``, based on the current | 309 automatically added for us by ``common.js``, based on the current |
308 toolchain/configuration combination: | 310 toolchain/configuration combination: |
309 | 311 |
310 .. naclcode:: | 312 .. naclcode:: |
311 | 313 |
312 <!-- | 314 <!-- |
313 Just as in part1, the <embed> element will be wrapped inside the <div> | 315 Just as in part1, the <embed> element will be wrapped inside the <div> |
314 element with the id "listener". In part1, the embed was specified in HTML, | 316 element with the id "listener". In part1, the embed was specified in HTML, |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
489 // postMessage sends a message to it. | 491 // postMessage sends a message to it. |
490 common.naclModule.postMessage('hello'); | 492 common.naclModule.postMessage('hello'); |
491 } | 493 } |
492 | 494 |
493 // This function is called by common.js when a message is received from the | 495 // This function is called by common.js when a message is received from the |
494 // NaCl module. | 496 // NaCl module. |
495 function handleMessage(message) { | 497 function handleMessage(message) { |
496 var logEl = document.getElementById('log'); | 498 var logEl = document.getElementById('log'); |
497 logEl.textContent += message.data; | 499 logEl.textContent += message.data; |
498 } | 500 } |
OLD | NEW |