I’ve got an onhashchange like so…
window.addEventListener("hashchange", afunction() , false);
which calls a function on hash change.. the problem is the function itself inserts a div into the page. This seems to cause the function to infinite loop re-calling itself over and over. Is there anyway I can modify my call so that it will not do this? and only change it if the rest of the page changes? Each time the rest of the page changes I want to update my div. The page is changing via AJAX and I’m using the rest of the page to construct my div so I must wait on till it finishes regenerating.
This line is wrong
It is saying take whatever
afunctionreturns and assign it to this event.You want to say assign a reference to
afunction, that means you do not want the ()