example: intro an emscripten wrapper around hello world
[nit.git] / examples / emscripten / hello_world / www / index.html
1 <!DOCTYPE html>
2 <!-- This file is part of NIT ( http://www.nitlanguage.org )
3
4 Copyright 2014 Alexis Laferrière <alexis.laf@xymus.net>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12 Unless required by applicable law or agreed to in writing, software
13 distributed under the License is distributed on an "AS IS" BASIS,
14 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 See the License for the specific language governing permissions and
16 limitations under the License.
17 -->
18 <html>
19 <head>
20 <title></title>
21 <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
22 <script>
23 // Redirect print to HTML
24 var Module = {
25 'print': function(text) {
26 $("#console").append(text + "\n");
27 $(document).title = text;
28 }
29 };
30
31 // Report full loading
32 $(document).ready(function() {
33 $("#loading").text( "Loaded and executed." );
34 });
35 </script>
36 </head>
37 <body>
38
39 <h1>Status</h1>
40 <p id="loading">Loading...</p>
41
42 <h1>Program output</h1>
43 <samp id="console"></samp>
44
45 <script src="hello_world.js"></script>
46
47 </body>
48 </html>