Permalink
Browse files

added license info + demo

  • Loading branch information...
1 parent 8869fa0 commit 532c9a2256fea009e6123b19896a16ca7fd13c84 @elbart committed Aug 12, 2010
Showing with 47 additions and 21 deletions.
  1. +0 −21 async_rendering.html
  2. +21 −0 demo.html
  3. +26 −0 lib/loader.js
View
21 async_rendering.html
@@ -1,21 +0,0 @@
-<html>
-
- <head>
- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
- <script type="text/javascript" src="lib/loader.js"></script>
- <script type="text/javascript">
- $(document).ready(function() {
- loadScriptAsync('http://localhost:8124');
- loadScriptAsync('http://localhost:8124');
- loadScriptAsync('http://localhost:8124');
- });
- </script>
-
- </head>
-
- <body>
- <img src="http://img.thesun.co.uk/multimedia/archive/00816/Jenni_Falconer_816598a.jpg" />
- <img src="http://images.buch.de/images-adb/aa/0a/aa0a3d8f-94e8-46d4-ad6e-a2b7900081bf.jpg" />
- <img src="http://ratgebaer.eu/WITZE/gelesen/pupsen.JPG" />
- </body>
-</html>
View
21 demo.html
@@ -0,0 +1,21 @@
+<html>
+
+ <head>
+ <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
+ <script type="text/javascript" src="lib/loader.js"></script>
+ <script type="text/javascript">
+ $(document).ready(function() {
+ loadScriptAsync('http://localhost:8124'); // this will throw the onload event even if the script is not loaded yet
+// $.getScript('http://localhost:8124'); // this will throw the onload event after the script is loaded
+ });
+
+ window.onload = function() {
+ alert('onload event thrown');
+ }
+ </script>
+ </head>
+
+ <body >
+ <img src="http://static.pe.meinvz.net/20100811-0/Img/logo.png" />
+ </body>
+</html>
View
26 lib/loader.js
@@ -1,3 +1,29 @@
+/**
+ * Copyright (c) 2010 VZnet Netzwerke Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to deal
+ * in the Software without restriction, including without limitation the rights
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ * copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ * THE SOFTWARE.
+ *
+ * @author Tim Eggert <teggert@vz.net>
+ * @copyright 2010 VZnet Netzwerke Ltd.
+ * @license http://www.opensource.org/licenses/mit-license.html MIT License
+ */
+
var loadScriptAsync = function(url) {
var body = document.body;
var div = document.createElement('div');

0 comments on commit 532c9a2

Please sign in to comment.