script.js icon indicating copy to clipboard operation
script.js copied to clipboard

path() method has no effect?

Open matthew-dean opened this issue 10 years ago • 4 comments

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 avatar Apr 25 '15 21:04 matthew-dean

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?

matthew-dean avatar Apr 25 '15 21:04 matthew-dean

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!

francisrod01 avatar May 30 '15 23:05 francisrod01

remove .js from the extension...

ded avatar Jun 02 '15 18:06 ded

@ded this version v2 is running on! :)

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

francisrod01 avatar Jun 02 '15 18:06 francisrod01