You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to report 2 issues I found when playing with this excellent script:
The script will insert image tag into <head>. Since the onload/onerror events will be fired after setting src, it might be better not to append the image to <head>.
I accidentally passed a blank array as paths to loadjs(), it could pass the loadFiles() without firing callbackFn(), the subsequent loading process was therefore skipped. It would be nice if some error handling about that can be added.
Thank you for creating such a good script.
The text was updated successfully, but these errors were encountered:
Happy to hear you like LoadJS! In terms of your issues, what's the disadvantage to inserting image tags into <head>? I tested it across browsers and didn't see any issues.
Let me think about the error handling for blank arrays some more...
Thank you for your reply. I didn't see any issues with Chrome too, but as mentioned, the onload/onerror events will be fired after setting src, preloading is done, no need to do more. I understand it needs to add extra code (e.tagName != "IMG") to distinguish images but this will keep the DOM clean. Only a tiny suggestion to make loadjs even better. Thanks.
I'd like to report 2 issues I found when playing with this excellent script:
The script will insert image tag into <head>. Since the onload/onerror events will be fired after setting src, it might be better not to append the image to <head>.
I accidentally passed a blank array as paths to loadjs(), it could pass the loadFiles() without firing callbackFn(), the subsequent loading process was therefore skipped. It would be nice if some error handling about that can be added.
Thank you for creating such a good script.
The text was updated successfully, but these errors were encountered: