-
Notifications
You must be signed in to change notification settings - Fork 20
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
Update/add #3
base: master
Are you sure you want to change the base?
Update/add #3
Conversation
Update: add localStorage check -> _loadScript(...) change for support no local localStorage add support css file
Update: add localStorage check -> _loadScript(...) change for support no local localStorage add support css file add all callback's are worked on when (xmlhttp.status != 200) in _cacheScript()
Very neet to add css support, but this pull request breaks the callback:
Gives an error However it works ok without a callback
|
|
Using your latest code, adding the boolean didn't matter (it's good to add it anyways). If I put the callback block at the top of all the other scripts (which are not loaded by requireScript), then it works right away. But if the block is after those scripts, then the problem arises and requires a refresh. Weird. Also, keep in mind to do a |
not when load the page: when press "Home" or "Options" on link
html
|
my Load Order :
|
Hey guys, I really appreciate your effort. As you can see, I have not worked on this project for a loooooong time. But the moment is good so I will have a look in the next weeks and join the discussion. Sory the time frame is not a bit more tight, but the situation dictates it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks this is just the first thing I saw, I will have a further look soon.
* @param {string} url (see `requireScript` or 'css') | ||
* @param {string} name (see `requireScript` or 'css') | ||
* @param {string} version (see `requireScript` or 'css') | ||
* @param {Boolean} css (false =js, true=css) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a string would be better here so the API is clearer so I would change this to type: ['css' || 'js]
, or we parse the url suffix, which should be even better since the API would not change.
var extension = url.split('.').pop()
if (extension === 'js') ...
if (extension === 'css') ...
or you could even do
var css = url.split('.').pop() === 'css'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- German
habe mal "cached-webpgr" zerlegt und zu einer version 2 überarbeitet!
js und css werden unterstütz!
vielleicht ist die Ideen/Überarbeitung Ansatz interessant für dich. - English translation by google
I disassembled "cached webpgr" and belonged to version 2!
js and css are processed!
Perhaps the ideas / revision approach is interesting for you.
Update/add:
add localStorage check -> _loadScript(...) change for support no local localStorage
add support for css file
add all callback's are worked on when (xmlhttp.status != 200) in _cacheScript()