龙卷风iframe src [英] Tornado iframe src

查看:149
本文介绍了龙卷风iframe src的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试以下列方式使用iframe:

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

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

Tornado服务器如下所示:

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"),
)

如何让我的iframe显示messages.html?

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

推荐答案

处理程序看起来很好。您只需要在

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>

这篇关于龙卷风iframe src的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆