Fork me on GitHub

onclick防止冒泡和json对象放入

onclick 阻止冒泡
onclick="aa_click(event,name)"

function aa_click(e,name){
    if ( e && e.stopPropagation ) {
        e.stopPropagation();
    } else {
        window.event.cancelBubble = true;
    }
    next(name)
}

json对象加入onclick

<div class="one_doctors" onclick="show_doctor_modal('+JSON.stringify(details[i]).replace(/\"/g,"'")+')">

 

 

posted @ 2018-06-29 11:11  森海轮回  阅读(633)  评论(0编辑  收藏  举报