Straight from source
function asyncLoadScript(src) { return function (onload, onerror) { var script = document.createElement('script'); script.type = 'text/javascript'; script.src = src;
My suggestion is to modify the script (which does not seem to contain much) to reflect the function, but for the link tag, not the script tag.
to reflect the OP comment
The script is built on top of chain.js, so it can be harder than expected.
If you donβt want something else, Iβm sure that what I wrote above is what you need to change so that it looks like this:
function asyncLoadScript(src) { return function (onload, onerror) { // Get file extension var ext = src.split('.').pop(); if (ext == "js") { var script = document.createElement('script'); script.type = 'text/javascript'; script.src = src; } else if (ext == "css") { var script = document.createElement('link'); script.type = 'text/css'; script.href = src; script.rel = "stylesheet"; }
Theoretically, this should work. Make another comment if it doesn't work.
user1508519
source share