Debian Codegraph @

test/headjs.html

raw
1 <!doctype html>
2 <html class="no-js">
3 <head>
4 <meta charset="utf-8"/>
5 <title>Test: SCRIPT via HeadJS</title>
6 <link rel="stylesheet" href="style.min.css" />
7 <script src="../dist/1.0.0/head.min.js"></script>
8 <script>
9 // calculate difference between zero and window.onload
10 window.onload = function () {
11 var stop = new Date();
12 document.getElementById("content").style.display = "block";
13 document.getElementById("ms").innerHTML = (stop - start);
14 };
15 </script>
16 <script>
17 var start = new Date();
18 head.js("http://ajax.googleapis.com/ajax/libs/mootools/1.4.5/mootools-yui-compressed.js")
19 .js("http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js")
20 .js("http://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js")
21 .js("http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js")
22 .js("http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js");
23 </script>
24 </head>
25 <body>
26 <div id="wrap">
27 <div id="nav" class="clear">
28 <a href="script.html">SCRIPT SRC <em>in head</em></a>
29 <a href="script-bottom.html">SCRIPT SRC <em>on bottom</em></a>
30 <a href="headjs.html">SCRIPT <em>via HeadjJS</em></a>
31 <br />
32 </div>
33 <div id="content" style="display: none">
34 <h1>SCRIPT SRC via HeadJS</h1>
35 <div id="time"><span id="ms"></span>ms</div>
36 <p>
37 Press <strong>CTRL+SHIFT+R</strong> or <strong>CTRL+F5</strong> to reload with an <strong>empty cache</strong> = first impression.
38 </p>
39 <br />
40 <p>
41 <strong>View source</strong> to see how scripts are provided.
42 </p>
43 <p>
44 Time is calculated when <code>window.onload</code> fires.
45 </p>
46 <p>
47 Try with different browsers. The time difference varies a lot.
48 </p>
49 <p class="details">
50 head.js() calls are always separate from the page rendering. Does not matter
51 whether you load on HEAD or on bottom. You can also load programmatically on
52 demand.
53 </p>
54 </div>
55 <div id="footer">
56 <a href="/site/unit.html">&laquo; Back</a>
57 &nbsp; | &nbsp; <a href="https://github.com/headjs/headjs/issues">found a bug?</a>
58 </div>
59 </div>
60 </body>
61 </html>