0

etc, current page and link: '/lessons/4' which is a normal page without emberjs and I want to redirect to

'/#/sections/2'

<a href="/#/sections/2">next_page</a>

Because the link is with hash, it will not reload in the next_page.

So how can I force it to reload?

My current solution is

<a href="#" onclick="javascript: window.location.reload(); window.location.href = '/#/sections/2'">Start</a>

Do you have any better solutions?

4

1 回答 1

0

一个更好的方法是在hash change上设置一个事件处理程序。

另请参阅可能对您有帮助的这个问题。我对emberjs不熟悉。

此外,rails 支持不显眼的 JavaScript,遵循此原则编写代码是一种很好的做法。

于 2013-08-04T01:24:04.237 回答