jquery mobile 使用pageshow 绑定页面事件时,会出现重复绑定,导致多次执行绑定事件。
绑定页面事件:
$(document).on( 'pageshow' , '#progress' , bindFunction);
function bindFunction(){
alert( '这是绑定函数' );
$(document).off( 'pageshow' , '#progress' , bindFunction ); //在绑定函数后面增加解绑事件
}
这样就不会重复绑定页面事件了。