I am using Flask, and I am trying to send data to my html page. The obvious choice is Jinja templating: {{ input_msg }}
, but the problem is I need I am inside curly brackets already, since I need to put the variable into javscript:
request.onload = function() {
if (request.status === 200 && request.responseText === 'done') {
window.location = {{ inp_msg }};
}
};
The above will not work because curley brackets are being used for templating, but inside javscript as well. Is there another way to send data, not jinja? If not, is there another jinja way?
Thanks in advance.
question from:https://stackoverflow.com/questions/65546348/jinja-templating-in-javscript