0

I have done pagination in wordpress with Jquery/Ajax/wp_pagenavi() which instead of reloading page refreshes only a div to load new content, it works fine but I would like to update part of URL as well - without reloading the page.With jQuery pagination url for Page 1, Page 2, Page 3 doesn't change and is always same : myhost.com/category/

I want it look as it would look with standard pagination :

add '/page/$paginated_page_number/' to base URL which is myhost.com/download/category/

myhost.com/download/category/page/2/
myhost.com/download/category/page/3/
myhost.com/download/category/page/4/  ... ...

I also plan to use jQuery div refresh for tags and I need to change part of URL without reloading page, when tag is choosen I will refresh div with new content and update URL :

replace : '/download/category/' to '/tag/$choosen_tag/'

How to replace part of URL without reloading the page ?

4

1 回答 1

1

您所描述的内容听起来像 HTML5 pushState。这个新的 API 允许开发人员通过 JavaScript 更改浏览器中显示的 URL,而无需重新加载页面。

我必须警告您,IE 尚不支持此功能。IE 团队计划在版本 10 中支持它。

更多关于浏览器历史操作的信息。

希望能帮助到你。

于 2012-04-29T15:57:08.910 回答