File: examples/demo1.html

Recommend this page to a friend!
  Classes of Thomas Björk   JS and CSS Resource Loader   examples/demo1.html   Download  
File: examples/demo1.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: Added sessionStorage as a cache engine
Added options.loadedFrom
Changed the options.cache to only be used to indicate if the cache should be used or not. The name of the cache key is moved to options.cacheName
Added options as an argument to the options.complete callback and the options.test callback
Updated the readme
New name and added style loading
Date: 2 years ago
Size: 536 bytes
 

Contents

Class file image Download
<!DOCTYPE html> <html> <head> <title>ScriptLoader Demo 1</title> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <script src="../resourceloader.js"></script> <script> window.resourceLoader.load("dummies/script1.js", {cache: true, cacheTimeout: 10, complete: function(options) { alert('Loaded this script: '+options.src); }}); console.log(window.resourceLoader.getVersion()); </script> </head> <body> <div></div> </body> </html>