I want to pass a string to some JavaScript in a template. However, the string is being interpreted as an (invalid) number when the JavaScript runs. How do I pass a string to a JavaScript variable?
@app.route('/loadNext')
def loadNext():
return render_template('next.html', value='1.1.1.1')
$("#loadtable").ready(
function(){
var tmp = {{ value }};
alert(tmp);
});
{{message.mac[0][0]}}
is not giving you the array in a JS-acceptable format. Have you checked what the format of the source looks like when it reaches the client? - Rory McCrossan