malko / l.js

another js loader

Home Page:http://malko.github.com/l.js/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enhance error handling

malko opened this issue · comments

as describe in issue #14, find and implement a way to allow for better error handling (using a callback instead of a fallback)

Hi, I have a case where script is loaded with the same method two times, first it work like a charm but at second time, even if load is same procedure is same it fails but I don't know why. Could it be possible to simply return an status_code and error_message in callback ?

Can you please provide a sample code to reproduce the error and i'll have a look to it.

See latest version I added a ljs.onError method + just fix a bug on #17
The probable reason may be that you include twice l.js like this: <script src="l.js>some code here</script>

Hello and thanks for your response but I found why it happens from my side. This was because I reloaded all js in a dynamic modal window. Ljs seams to consider which script were already loaded and don't work if duplicates (that's nice usually). So decided to delete and reload Ljs in this case and it works fine for me now. So, thanks for your follow up, I'll take a look on the new version a little bit later.