javascript - Passing variables from views.py into script.js -
i wondering whether or not possible pass variables render_to_response in views.py script.js,
render_to_response('appname/basic.html',{'var':somevariable}) i want access variable {{var}} outside of html page since script.js uses like:
function willhappen() { var n = noty({ text: 'you're {{var}}!', type: 'warning', dismissqueue: false, layout: 'center', theme: 'defaulttheme' }) } it works if put javascript html page wanted separate them since might using in lot of html pages.
a no solution writing code between <script></script> in html file
maybe in my_script.html:
<script> function willhappen() { var n = noty({ text: 'you're {{var}}!', type: 'warning', dismissqueue: false, layout: 'center', theme: 'defaulttheme' }) } </script> but, good?
Comments
Post a Comment