0

I have the following code:

        History.Adapter.bind(window,'statechange',function(){
        console.log("triggered");

How can I trigger this function from anywhere in my code?

BenMorel
  • 31,815
  • 47
  • 169
  • 296
matthias
  • 1,712
  • 16
  • 39
  • possible duplicate of [How to trigger event in JavaScript?](http://stackoverflow.com/questions/2490825/how-to-trigger-event-in-javascript) – GJK Feb 26 '14 at 15:06

1 Answers1

0

If you are using History.js then use

History.pushState(data,title,url);
Gaurav
  • 1,058
  • 2
  • 8
  • 17
  • hm... I want to trigger this function without Hitory.pushState. Because when I open the page the first time there might be already something like: home.html?add and then it should load the add page – matthias Feb 26 '14 at 15:23