這是兩個事件 popup把cb傳入 popupHide事件中function popup(title, content, cb, leftText) { var _html ='<span class="mui-popup-button" onclick="popupHide(' + cb + ')">' + lText + '</span>'
}function popupHide(cb){ typeof cb === 'function' && cb();
}然后我執行并把$(this)傳入后報了個 Uncaught ReferenceError: _this is not defined$('body').on('tap', '.removeNumber', function () { var _this = $(this);
api.popup('title', 'center', function () { console.log(_this); //deleteCard(_this)
})
});
js兩次回調后拿不到觸發事件里聲明后的值
三國紛爭
2018-12-16 15:10:41