ded / script.js

Asyncronous JavaScript loader and dependency manager
MIT License
2.95k stars 340 forks source link

Support progress callback #80

Open tot-ra opened 9 years ago

tot-ra commented 9 years ago

Would be nice if script loading() could report about % of progress while loading (if JS is ~2 mb then it would be useful), as suggested by Mozilla, its possible with ajax.. https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Monitoring_progress

Flux159 commented 9 years ago

Don't know if you got your answer already, but scriptjs doesn't use xhr ("ajax") to load its scripts. It creates a script element in the DOM that loads the scripts (see: https://github.com/ded/script.js/blob/master/src/script.js#l66). This doesn't support the onprogress event that xhr supports.