Tornado iframe src

谁说胖子不能爱 提交于 2019-12-13 07:07:40

问题


I am trying to use an iframe in the following way:

<iframe src="????" width="350" height="500"></iframe>

where the Tornado server look like this:

class FrameHandler(RequestHandler):
    def get(self):
        user = self.get_argument("username")
        self.set_cookie("user", user)
        out = tableizer(user)
        self.render('messages.html',table=out)

application = tornado.web.Application(
    [
        (r"/frame", FrameHandler),
    ], 
    debug=True,
    template_path=os.path.join(os.path.dirname(__file__), ""),
    static_path=os.path.join(os.path.dirname(__file__), "static"),
)

How do I get my iframe to display messages.html?


回答1:


The handler looks good. You only need to substitue ???? in

<iframe src="????" width="350" height="500"></iframe>

with:

<iframe src="/frame?user=whoever" width="350" height="500"></iframe>


来源:https://stackoverflow.com/questions/11128832/tornado-iframe-src

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!