Slowscript
javascript lazyload unit able with AMD
Install / Use
/learn @flrngel/SlowscriptREADME
slowscript
javascript lazyloader with Mutation Detection
Usage
<script type="text/slowscript" src="test.js"></script>
<script type="text/slowscript" src="test"></script>
recommend
<noscript type="text/slowscript" src="test.js"></noscript>
On AMD ( Example with RequireJS )
See more RequireJS-example
require(['slowscript'],function(slowscript){
slowscript.execute();
});
Development
npm install
grunt
Examples
Basics
slowscript is using singleton design pattern.
Variables
$global
Advantage of singleton design pattern, you can use this variable as global variable.
Method
execute()
This method is for execute slowscript as hand-operated
on mutation event, this method will run automatically. (plan to choose optional on future version)
queue(<function>)
This method is for queuing predefined functions, wait for queue to execute.
queue_execute()
This method executes functions in queue which is defined. Probably uses on lazy-loaded script.
LICENSE
MIT
