lazyload 和 jquery mobile 之间的冲突破坏了使用$.mobile.changePage
和$.mobile.navigate
在 phonegap iOS 构建中的预期结果。
虽然它适用于桌面浏览器,但不适用于 iOS 版本(例如那些 phonegap 提供的)。
问题是由这部分代码引起的:
/* With IOS5 force loading images when navigating with back button. */
/* Non optimal workaround. */
if ((/iphone|ipod|ipad.*os 5/gi).test(navigator.appVersion)) {
$window.bind("pageshow", function(event) {
if (event.originalEvent.persisted) {
elements.each(function() {
$(this).trigger("appear");
});
}
});
}
堆栈跟踪中的问题event.originalEvent
是undefined
.