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

path() method has no effect? #82

Open
matthew-dean opened this issue Apr 25, 2015 · 4 comments
Open

path() method has no effect? #82

matthew-dean opened this issue Apr 25, 2015 · 4 comments

Comments

@matthew-dean
Copy link

I have jquery located at /js/lib/jquery.js.

This is my code:

$script.path('/js/');       
$script('lib/jquery.js', 'jquery', jQueryLoaded);

The jQueryLoaded function never gets called, and Chrome Developer Tools says that the request was for /lib/jquery, not /js/lib/jquery. Any ideas?

@matthew-dean
Copy link
Author

Er, looking through the code, it appears the documentation is outdated, and in order for the path method to apply, all of the JS files need to NOT have '.js' as part of the call?

@francisrod01
Copy link

I have the somme problem!! =(

https://github.com/ded/script.js#scriptpath

<!-- your app's js -->
    <script src="App/Script.js"></script>
    <script type="text/javascript">
        $script('lib/angular-route/angular-route.min.js');
        $script([
            'App/App.js', 'App/Controller.js'
        ], function() {
            angular.bootstrap(document, ['starter']);
        });
        $script.path('Controllers/', function(err) {
            console.log(err);
        });
    </script>

See screenshot:

angular structure

Console error:

Error: [ng:areq] Argument 'HomeCtrl' is not a function, got undefined
http://errors.angularjs.org/1.3.13/ng/areq?p0=HomeCtrl&p1=not%20aNaNunction%2C%20got%20undefined

Please, help me with this problem!

@ded
Copy link
Owner

ded commented Jun 2, 2015

remove .js from the extension...

@francisrod01
Copy link

@ded this version v2 is running on! :)

https://github.com/ded/script.js/blob/v2/src/script.js

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

3 participants