stewartpark / Flask-JSGlue

Flask-JSGlue helps hook up your Flask application nicely with the front end.
80 stars 40 forks source link

Problem with javascript and jinja tags? #11

Closed rlam3 closed 8 years ago

rlam3 commented 8 years ago

I'm trying to do this within my imported javascript and it does read it upon page load

var x = {{x.title}}

So javascript must be embedded inside the jinja tempalte itself?

rlam3 commented 8 years ago

Is there a better way to use this along with my jinja template with javascript? Thanks

stewartpark commented 8 years ago

You can generate a JS file with a template, but I wouldn't recommend that generally. maybe look for JSONP or the like to get server-side objects from the client.

It may be a good idea to have this on JSGlue to provide a more transparent interface between Python and Javascript since that's the project's main goal. But I'm afraid that other important features are awaiting. PRs are always appreciated! :)