It has problem to write code like that:
js = tornado.template.Template("""
// jquery here
.............
// my js codes here
...........
""")
and then in my request handler write code like that:
return self.finish(js.generate(*args, **kwargs))
But I run it as another way just save my js code into a file js.html, and it works right by the codes:
return self.render("js.html")
I am very confused that why tornado or python works like that. That two ways looks like as the same.
That any one would give me any tips to deal with it?
Thanks!