It's a good practice to include js
file as partials
in Handlebars?
I mean, I need to use some data from nodejs
in my jquery
-based javascript, and to do this I load my js
as partials
in handlebars template and then use handlebars notation directly, this way:
$(document).ready(function() {
var myVar = {{value_from_db}};
});
I know this it's not the correct way, I hope I've explained what I need.
In my case, I need to use MapBox
coordinates inside the js
, where the coordinates are get from database, this way:
var map = L.mapbox.map('map', 'mapbox.streets', {
zoomControl: false,
attributionControl: false
}).setView([my_lat, my_lng], 3);