开发者

Keep track of site history? [duplicate]

开发者 https://www.devze.com 2023-03-21 18:26 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: How to keep the browser history in sync when using Ajax?
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

How to keep the browser history in sync when using Ajax?

I think this is a rather easy fix but I can't find an answer a开发者_Python百科nywhere else...so here goes...I made this kind of template for my homepage...I know the code's not insanely elegant but my main problem is that what if I want to send someone to a specific part of my page...rather than just my "home"...take a look http://useless-r-us.t15.org/

I mean how can I reference each of "blag", "projects", and "about me" using some unique url but still have my pretty css3 transitions...I'm thinking something like this...

http://radokirov.com

P.S....I know blag is a typo --> http://xkcd.com/148/


You should use url hashes (the part of the url following the # sign).

Then, in javascript, in the ready (jquery) event handler, based on the url's hash, you should do the appropriate ajax request and populate the page with the appropriate content.

For more details: Modify Address Bar URL in AJAX App to Match Current State

0

精彩评论

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