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

Add .path() method like on $script.path() #77

Open
yourchoice opened this issue Sep 10, 2018 · 3 comments
Open

Add .path() method like on $script.path() #77

yourchoice opened this issue Sep 10, 2018 · 3 comments

Comments

@yourchoice
Copy link

Add .path() method like on $script.path()

@amorey
Copy link
Member

amorey commented Sep 11, 2018

I can see how this would be useful but you can already do this by prefixing the paths yourself (you can also use a before callback function). I'm curious to see how many other people have this problem. Unless it's a common issue, my preference is for keeping the LoadJS feature set to an absolute minimum.

@yourchoice
Copy link
Author

I say in idea if there are many files to load in same path to reduce the code:

loadjs(['foo.js', 'bar.js'], 'foobar', { 'path_prefix': '/path/to/' });

@amorey
Copy link
Member

amorey commented Sep 11, 2018

If you'd like to start doing this now you can use the before callback:

loadjs(['foo.js', 'bar.js'], 'foobar', {
  before: function(path, scriptEl) {scriptEl.src = '/path/to/' + path;}
});

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

No branches or pull requests

2 participants