Attempt to use async + defer to speed up loading of MathJax.

This commit is contained in:
Georges Dupéron 2017-03-24 16:34:25 +01:00
parent d9c3a561ca
commit 3a29f77dc1

View File

@ -59,15 +59,17 @@
(collection-file-path "MathJax" "scribble-math")))
|#
(define (load-script-string src)
(define (load-script-string src [async-defer #f])
(string-append
#<<EOJS
(function() {
document.write('<scr' + 'ipt type="text/javascript" src="
EOJS
src
"\""
(if async-defer " async=\"async\" defer=\"defer\" " "")
#<<EOJS
"></scr' + 'ipt>');
></scr' + 'ipt>');
})();
EOJS
))