Skip to content

Conversation

caffeineaddiction
Copy link

No description provided.

original script was making 2x requests to server due to `_loadScript` setting the `src` attribute of the `<script>` element ... as it turns out you can recursively call `requireScript` from `_cacheScript` and eat your own dog food.  This kills 2 birds with one stone, it doesnt double load content on the first pass, and it shrinks the total size of the script itself because `_loadScript` can be deleted

I also made the script AMD compatible

It should be noted that removing `_loadScript` breaks backwards compatibility for browsers that do not support local-storage though I plan on adding this functionality back into the `requireScript` function along with some code to specifically check if the browser supports local storage.
@select
Copy link
Owner

select commented Apr 26, 2017

Hey there, I did not forget this, but I had no time so far. Will get to this soon hopefully. Thanks already 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants