Icontem

File: examples/demo2.html

Recommend this page to a friend!
  Classes of Thomas Björk  >  JS and CSS Resource Loader  >  examples/demo2.html  >  Download  
File: examples/demo2.html
Role: Example script
Content type: text/plain
Description: Documentation
Class: JS and CSS Resource Loader
Load cached JavaScript and CSS from localStorage
Author: By
Last change:
Date: 4 years ago
Size: 625 bytes
 

Contents

Class file image Download
<!DOCTYPE html>
<html lang="en">
 <head>
  <title>Simple demo</title>
  <script src="../resourceloader.js"></script>
  <script>
    var options = {
      cache: true,
      cacheTimeout: 7200,
      complete: function(options) {
        alert("Loaded "+options.src+" from "+options.loadedFrom);
      },
      test: function(options) {
        if(typeof(dummyObject) != "undefined") {
          return true;
        }
        return false;
      }
    }
    window.resourceLoader.load("dummies/script1.js", options);
    window.resourceLoader.load("dummies/script1.js", options);
  </script>
 </head>
 <body>
 </body>
</html>