Search code examples
jqueryjquery-tools

jQuery Tools - Can you manually set the url in the history plugin?


I am using the jquery tools history plugin to add history functionality page. I am using this code

$("a.links_with_history").history(function(event, hash) {

});

Is there a way to manually set the url here instead of getting the value from the href attribute of the anchor tag?

EDIT: For the purposes of this question, assume that we are going to use jQuery tools and not another plugin.


Solution

  • If I were you, I'd use a similar plugin: History.js.

    Then, what you need is a pushState. This is what it says in the read me:

    History.pushState(data,title,url)
    

    Pushes a new state to the browser; data can be null or an object, title can be null or a string, url must be a string