开发者

Using Page anchors on django

开发者 https://www.devze.com 2022-12-28 09:46 出处:网络
I would like to have AppEngine render an html page that auto scrolls to an html anchor point.I\'m not sure how and where to pu开发者_运维百科t that type of instruction.

I would like to have AppEngine render an html page that auto scrolls to an html anchor point. I'm not sure how and where to pu开发者_运维百科t that type of instruction.

    template_values = { 
    'foo' : 'foo',
    'bar': 'bar',
    'anchor' : '#MyPageAnchor'  # ?? Something like this...
    }
    path = os.path.join(os.path.dirname(__file__), fileName) 
    self.response.out.write(template.render(path, template_values))

Is this possible? How do I accomplish this?


There's nothing App Engine specific here. You simply have to redirect the user to a URL that includes the anchor (eg, http://example.com/foo#anchor).

0

精彩评论

暂无评论...
验证码 换一张
取 消