Open johnstaveley opened 11 years ago
There is a clash between JQuery mobile and this library because they are both handling the History .. I got rid a similar error "Cannot read property 'state' of undefined" by calling this line of code before pageinit.
$.mobile.pushStateEnabled = false;
I found the info on this page : http://jquerymobile.com/demos/1.2.0/docs/pages/page-navmodel.html
You have to set this before document ready, otherwise it won't work.
I am using History.js with jQuery mobile (latest versions of both) and when I change state I get the following javascript error even though everything appears to work fine:
TypeError: e.originalEvent is undefined var poppedState = e.originalEvent.state,
the error occurs in jQuery.mobile-1.2.0.js on this line:
onPopState: function( e ) { var poppedState = e.originalEvent.state, fromHash, toHash, hashChanged;
my calling code:
History.pushState({ view: 'home' }, "Home", "Main?view=home");
it appears the history handling in jquery mobile is colliding with History.js. Is this a problem or can I ignore it? I don't like errors hanging around that I don't understand! Cheers