[SPIP][PLUGINS] v3.0-->v3.2
[lhc/web/www.git] / www / plugins-dist / compresseur / lib / jQl / README
1 JQuery Loader
2 =============
3
4 Help to async load jQuery and supporting inline javascript with calls like:
5
6 $(function(){})
7
8 or
9
10 $(document).ready(function(){})
11
12
13 Include it, then just call:
14
15 jQl.loadjQ('//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');
16
17 You can also use it to load jQuery-dependent module in parallel,
18 it will be queue and run after jQuery is loaded:
19
20 jQl.loadjQ('//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js');
21 jQl.loadjQdep('my.example.com/js/myplugin.jquery.js');
22
23 If you use a defer inline script, you have to manually call boot() function :
24
25 <script defer="defer" type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
26 <script type="text/javascript">jQl.boot();</script>
27
28 jQuery will be loaded without blocking browser rendering,
29 and during this all inline calls to $(document).ready() and $.getScript() will be queued.
30
31
32 As soon as jQuery is ready,
33 all queued inline calls will be run respecting their initial order.
34
35 Be careful
36 ==========
37
38 At the moment, inline call executions are not waiting jQuery-dependent modules,
39 but only jQuery core.
40
41 However, when jQuery is loaded, jQuery-dependent modules already loaded
42 are run before inline scripts. But if some modules are longer to load and arrive
43 after jQuery, they will be run after queued inline calls.
44
45 v 1.2.0
46 (c) 2010-2016 Cedric Morin licence GPL