I’m getting desperate trying to get the jQuery mobile pagebeforeload event to fire. This just does nothing:
$(document).on("pagebeforeload", function( e, data ) {
console.log("hello");
});
According to the JQM docs, the syntax is correct. Still, nothing happens. Can anybody tell me why that is?
Make sure you’re including
preventDefault();Otherwise, it’ll just merrily continue loading.Docs: http://jquerymobile.com/demos/1.1.0/docs/api/events.html