Hello - I've got a javascript function that includes some volt language that I'd like to break out into its own javascript file:
function savePost(id, btn){
$.get('{{ url('logs/cart/add/') }}' + id, function(data){
// to stuff here
})
}
If i include this on the .volt page, it works fine -- because volt parses the page and all is good. However, I can't put this in a .js file, since volt doesn't parse those.
Is the best way to do this to just create the function in the template that those particular pages extend?