I was wondering whether or not it was possible to pass variables from render_to_response in views.py into script.js,
render_to_response('appname/basic.html',{'var':somevariable})
I basically want to access the variable {{var}} outside of the HTML page since my script.js uses something like:
function WillHappen()
{
var n = noty({
text: 'You're {{var}}!',
type: 'warning',
dismissQueue: false,
layout: 'center',
theme: 'defaultTheme'
})
}
It works if I put the Javascript into the HTML page but I wanted to separate them since I might be using it in a lot of my HTML pages.