How can I use hash in URL?


#1

Hi.

My app renders a page that generate anchors with id for hash dynamically.
Even if I specify a hash in URL on a browser, no scrolling for it happens.

How can I get scrolling?

Actually my app uses Iron Router.
And I made sure that Iron.Location.go() works after page rendering if current path is not same as specified.

So I imagine that if the app renders a page with no hash then executes Iron.Location.go in rendered handler of template, it may work.
But it is not smart. Are there any simpler solution?

Thanks,

ICHIKAWA, Yuji


#2

I think if the template isn’t rendered on the page when the page is rendered, there is no way a URL hash would work. You definitely need to re-scroll the page after the template is rendered - the way you are doing it seems OK.


#3

I am sorry for my late reply and thank you for your encouragement!