1

I'm making a web application that uses hash tags for page navigation like this

http://foo.bar.com/#pages/home

I just realized that one of my pages is going to be kind of huge, containing it's own tree-structured menu with links that should scroll the page to different anchor tags in the page. Obviously I can't use actual hash tags for that now, since they are busy. I'm going to have to use a programmatic solution with an URL like this

http://foo.bar.com/#pages/home/section

Or would it be possible to use more than one hash symbol, perhaps changing it to this?

http://foo.bar.com/#!/pages/home#section

But how can this be done programmatically anyway?

4

2 回答 2

1

你的问题对我来说似乎不清楚,

如果您的页面太大,您可以使用 AJAX 和 PHP 进行分页,更多 http://www.codediesel.com/php/simple-pagination-in-php/

http://www.99points.info/2011/01/ajax-pagination-using-jquery-and-php-with-animation/

否则,如果您仍然希望内容位于 URL #tags 中,那么您可以使用它。我怀疑你可以给这样的东西“ http://foo.bar.com/#pages/home/

您也可以尝试 URL 重写http://httpd.apache.org/docs/2.0/misc/rewriteguide.html

于 2012-02-08T14:20:38.077 回答
1

我会放弃对 hashbangs 的破坏性使用,改用历史 API并认真考虑“如果要替换这么多内容,通过 Ajax 加载它真的有好处吗?”的问题。

于 2012-02-08T14:23:32.197 回答