Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multiple onpopstate event

I need to work with History API for an application. My problem is that some "home" jQuery plugins already implement an event for popstate

it is possible to have more than one popstate event for an unique view ?

like image 326
OrcusZ Avatar asked Jan 04 '17 11:01

OrcusZ


1 Answers

window.addEventListener("popstate", console.log);
window.addEventListener("popstate", function(){console.log("I am also called")});

This seems to work fine for me.

Edit: Now with multiple events. For some reason Chrome won't fire twice the console log of the event though

like image 196
Axnyff Avatar answered Sep 27 '22 22:09

Axnyff