script.js icon indicating copy to clipboard operation
script.js copied to clipboard

async loading CDD

Open kofifus opened this issue 9 years ago • 6 comments

As far as I understand script.js does not support CSS files

Wouldn't it be cool to add it ? for example using the code from https://github.com/filamentgroup/loadCSS ?

Thanks!

kofifus avatar Jan 17 '16 08:01 kofifus

@kofifus I have an implementation this on my fork of script.js. you can check it out by cloning the repo

use the following code to async-ly load CSS $script.get("../path/to/css", function(){ alert("all done!"); });

isocroft avatar Jan 18 '16 14:01 isocroft

though my implementation is unlike the loadCSS project by @scottjehl

isocroft avatar Jan 18 '16 14:01 isocroft

supported even in IE6

isocroft avatar Jan 18 '16 14:01 isocroft

kul man, do you have in docs for your fork ? also is there a way in your implementation to know when the CSS finished loading ? thx!

kofifus avatar Jan 19 '16 21:01 kofifus

@kofifus i don't have docs available for this implementation. I may just have to edit the README.md file a little in the comming days to give brief examples. there is a second argument to the get llback to detect when you are done loading CSS

isocroft avatar Jan 20 '16 14:01 isocroft

Any news on this? I'd also be happy to see CSS loading in script.js!

forman avatar Jun 02 '17 11:06 forman