Search code examples
javascriptjqueryscrollbrowser-history

history.back is breaking bind('scroll')


On the document ready of my page I bind the scroll event like this:

$(window).bind('scroll', function() 
{
    alert('scroll');
});

Now this is working perfectly. But when I navigate to a page and then navigate back using history.back the code is not executed anymore. While other binds like 'click' are still working.

How can I solve this? Is there something I am doing wrong?


Solution

  • I solved the problem by using the "pageshow" and "pagehide" event and recalling the javascript