I want to fire a function every time I change a page in Liferay.
Liferay.on('endNavigate', function(event) {
functionToExecuteOnEveryPage();
});
It works, but every time I change the page the event 'endNavigate'
is invoked multiple times.
The first time I change the page the function is executed once, and the second time I change the page the function is executed two times, and the third time I change the page the function is executed three times, and so on..
How can I prevent this behavior?