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
  • 34,448
  • 50
  • 182
  • 322
matthias
  • 1,938
  • 23
  • 51
  • 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,078
  • 2
  • 8
  • 18
  • 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