封装函数
// 阻止默认跳转
function stopDefault(e) {
if (e&&e.preventDefault){
e.preventDefault();
}else{
window.event.returnValue = false;
return false;
}
}
函数调用
//方法一
$(document).ready(function(){
$(document).on('click','a',function(e){
stopDefault(e);
});
});
//mui-app方法
mui('#newsContent').on('tap', 'a', function(e) {
stopDefault(e);
});