jquery and the # sybmol in the url (and ajax)
So I've got a simple page with different ways to filter the data (almost everything is working.) For example, you have a page with a list of the users. You can choose a page number, you can choose what to sort by (and what direction to sort in) and how many results per page.
The way it works is whenever one of those variables are changed, I have jquery use POST ajax to get the table data from the server (passing the vars so my server can get the data correctly).
One thing I'm wondering is how to use the url to help with this. I want to be able to limit data in an additional way. For example, if you're viewing "example.com/users/index#topvisitors" then the server only sends back a list of the top visitors or "example.com/users/index#bannedusers" might return all banned users.
In the end, I really just ne开发者_JAVA技巧ed a way for the url to help my server return a more specific data set
Ideas?
You could always use window.location.hash
to get the current anchor, then pass that value as a parameter to your server-side script.
精彩评论