Attempt to use async + defer to speed up loading of MathJax.
This commit is contained in:
parent
d9c3a561ca
commit
3a29f77dc1
|
@ -59,15 +59,17 @@
|
||||||
(collection-file-path "MathJax" "scribble-math")))
|
(collection-file-path "MathJax" "scribble-math")))
|
||||||
|#
|
|#
|
||||||
|
|
||||||
(define (load-script-string src)
|
(define (load-script-string src [async-defer #f])
|
||||||
(string-append
|
(string-append
|
||||||
#<<EOJS
|
#<<EOJS
|
||||||
(function() {
|
(function() {
|
||||||
document.write('<scr' + 'ipt type="text/javascript" src="
|
document.write('<scr' + 'ipt type="text/javascript" src="
|
||||||
EOJS
|
EOJS
|
||||||
src
|
src
|
||||||
|
"\""
|
||||||
|
(if async-defer " async=\"async\" defer=\"defer\" " "")
|
||||||
#<<EOJS
|
#<<EOJS
|
||||||
"></scr' + 'ipt>');
|
></scr' + 'ipt>');
|
||||||
})();
|
})();
|
||||||
EOJS
|
EOJS
|
||||||
))
|
))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user