92 lines
		
	
	
	
		
			3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			92 lines
		
	
	
	
		
			3 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <!doctype html>
 | |
| <html class="no-js">
 | |
| <head>
 | |
|     <meta charset="utf-8" />
 | |
|     <title>Test: SCRIPT ordered via HeadJS</title>
 | |
|     <link rel="stylesheet" href="style.min.css" />
 | |
|     <script>
 | |
|         // calculate difference between zero and window.onload
 | |
|         var now = new Date();
 | |
|         window.onload = function () {
 | |
|             document.getElementById("content").style.display = "block";
 | |
|             document.getElementById("ms").innerHTML = (new Date()).getTime() - now.getTime();
 | |
|         };
 | |
|     </script>
 | |
|     <script src="../dist/1.0.0/head.min.js"></script>
 | |
|     <script>
 | |
|         head.js(
 | |
|             { a: "http://ajax.googleapis.com/ajax/libs/mootools/1.4.5/mootools-yui-compressed.js" },
 | |
|             { b: "http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" },
 | |
|             { c: "http://ajax.googleapis.com/ajax/libs/prototype/1.7.1.0/prototype.js" },
 | |
|             { d: "http://ajax.googleapis.com/ajax/libs/jqueryui/1.9.1/jquery-ui.min.js" },
 | |
|             { e: "http://ajax.googleapis.com/ajax/libs/swfobject/2.2/swfobject.js" });
 | |
|         
 | |
|         head.ready("a", function () {
 | |
|             if (window.console)
 | |
|                 console.info("a");
 | |
|         });
 | |
|         head.ready("b", function () {
 | |
|             if (window.console)
 | |
|                 console.info("b");
 | |
|         });
 | |
|         head.ready("c", function () {
 | |
|             if (window.console)
 | |
|                 console.info("c");
 | |
|         });
 | |
|         head.ready("d", function () {
 | |
|             if (window.console)
 | |
|                 console.info("d");
 | |
|         });
 | |
|         head.ready("e", function () {
 | |
|             if (window.console)
 | |
|                 console.info("e");
 | |
|         });
 | |
|     </script>    
 | |
| </head>
 | |
| <body>
 | |
|     <div id="wrap">
 | |
| 
 | |
|         <div id="nav" class="clear">
 | |
|             <a href="script.html">SCRIPT SRC <em>in head</em></a>
 | |
|             <a href="script-bottom.html">SCRIPT SRC <em>on bottom</em></a>
 | |
|             <a href="headjs.html">head.js <em>on head</em></a>
 | |
|             <br />
 | |
|         </div>
 | |
| 
 | |
|         <div id="content" style="display: none">
 | |
| 
 | |
|             <h1>head.js</h1>
 | |
| 
 | |
|             <div id="time"><span id="ms"></span>ms</div>
 | |
| 
 | |
|             <p>
 | |
|                 Press <strong>CTRL+SHIFT+R</strong> to reload with an empty cache = first impression.
 | |
|             </p>
 | |
| 
 | |
|             <p>
 | |
|                 <strong>View source</strong> to see how scripts are provided.
 | |
|             </p>
 | |
| 
 | |
|             <p>
 | |
|                 Time is calculated when <code>window.onload</code> fires.
 | |
|             </p>
 | |
| 
 | |
|             <p>
 | |
|                 Try with different browsers. The time difference varies a lot.
 | |
|             </p>
 | |
| 
 | |
|             <p class="details">
 | |
|                 head.js() calls are always separate from the page rendering. Does not matter whether you load on HEAD or on bottom. You can also load programmatically on demand.
 | |
| 
 | |
|             </p>
 | |
| 
 | |
|         </div>
 | |
| 
 | |
|         <div id="footer">
 | |
|             <a href="/site/unit.html">« Back</a>
 | |
|               |   <a href="https://github.com/headjs/headjs/issues">found a bug?</a>
 | |
|         </div>
 | |
| 
 | |
|     </div>
 | |
| </body>
 | |
| </html>
 | 
