Skip to content
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

script js doesn't load all scripts #84

Open
Duskfall opened this issue Aug 6, 2015 · 6 comments
Open

script js doesn't load all scripts #84

Duskfall opened this issue Aug 6, 2015 · 6 comments

Comments

@Duskfall
Copy link

Duskfall commented Aug 6, 2015

I have an array of scripts that load together (order is insignificant) and script js fails to load them.
For example test4 and test 7 don't load, making the app not to bootstrap at all.
This happens at random times in chrome and every time i open an incognito window and try the url

   $script.ready('dependencies', function () {

    console.info("loaded dependencies");

    $script([
            'Libs/test1',
            'Libs/test2',
            'Libs/test3',
            'Libs/test4',
            'Libs/test5',
            'Libs/test6',
            'Libs/Subfolder/test7'
    ], function () {

        console.info("bootstraping app");
        angular.bootstrap(document, ['nlgApp']);
    });
@amorey
Copy link

amorey commented Aug 6, 2015

I believe that script.js doesn't handle error callbacks because they're not supported in older browsers (LTE IE8). Here's the relevant code:
https://github.com/ded/script.js/blob/master/src/script.js#L65-L77

In case it helps, I wrote a script.js-compatible library that handles error callbacks but it only works in modern browsers (IE9+):
https://github.com/muicss/loadjs

@Duskfall
Copy link
Author

Duskfall commented Aug 6, 2015

I only need from IE10+ so it will be optimal!
Thanks i'll try it :)

@juanpmarin
Copy link

I have the same error, @Duskfall loadjs works for your case ?

@boye
Copy link
Contributor

boye commented Dec 13, 2016

@Duskfall have you tried $script.order already? See: https://github.com/ded/script.js/blob/master/src/script.js#L86

PS as far as I know it's not documented anywhere...

@Duskfall
Copy link
Author

I have moved away from scriptjs long ago, now using SystemJS module loading system to get ready for ES2016 with Typescript.

@boye
Copy link
Contributor

boye commented Dec 14, 2016

Ah, i didn't noticed the date of this issue :') that figures

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

No branches or pull requests

4 participants