-
Notifications
You must be signed in to change notification settings - Fork 510
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
async script and serie #95
Comments
Hmm that's weird because the serie param is supposed to make the lib wait for the script to have been effectively loaded (when the onload event has been called) to include the next script. |
I think the serie param is correctly waiting for the js file to load before proceeding to the next one. |
Ah yes that would make sense ! |
Great module! Thank you!!!
I'm loading my custom angular module along with a few dependencies (specifically, jquery then a jq plugin) and so I'm using the serie config option to make sure jquery is ready for the plugin.
But, it appears the buildElement function always includes the async attribute for scripts and my jq plugin seems to be getting executed before jquery finishes loading.
I was able to fix this locally by changing line 111 from:
el.async = 1;
to:
el.async = (params.serie?0:1);
Alternatively, maybe the async attribute could be conditionally removed using a parameter in the load config...
Is this an appropriate fix or is there another approach using ocLazyLoad to avoid async scripts from executing out of sequence?
The text was updated successfully, but these errors were encountered: