I’m a little confused about how to include javascript alongside plugin functions. If I do this:
myplugin/myplugin.php
function myPluginFunction() {
...
}
js('/assets/plugins/myplugin/js/scripts.js')
myplugin/assets/js/scripts.js
console.log('success!');
it doesn’t work. This error comes up in the console:
scripts.js:1 Uncaught SyntaxError: Unexpected token <
and when I look at the resource in Dev Tools, it looks like this:
<script src="http://project.dev/assets/plugins/myplugin/js/reset.js"></script>console.log('success!')
I could always just load these scripts in my templates, but in this case I need to add a small bit of JS functionality to the panel.
What’s up?