★ $(document).on('click', 'button[name=closeLayerOut2]', function () { ...... });
$(document).on('click', 'button[name=form-reset-button],a[name=form-reset-button]', function () { ...... });
$("form[id=importClassInfoForm] input[type=file]").on("change", function () { ...... });
$('form[id=qualityEdit-edit-form] select[id = selUndertaker]').attr("disabled", true);
$(document).on('click', '#saveBtu_add', function () { ...... });
$('a.deleteTrainingClassBtn').on('click', function () { ...... }); ★ <a href="javascript:void(0);" onclick="downFile('${c.uploadRateNoticeId}')" class="link">下载</a>
downFile = function (id) {
window.location.href = SPICA_MODULE + "/signupClassInfoController/downloadData/" + id;
}
☆ $(".className_scan_class").bind("click", function () { //适用于table 每一行的动态点击事件
//$(this).attr('data_plan_id');
});
<td title="${obj.className}">
<div data-plan-id="${obj.id}" id="className_scan_id" class="link specialTopic superPart className_scan_class">${obj.className}</div>
</td>
☆ 准确获取控件val(或者赋值):
var aa0 = $('form#signupAdd-edit-form input#classNum_add').val();
var bb0 = $('form[id=signupAdd-edit-form] input[id=classNum_add]').val();
var cc1 = $(' input[id=classNum_add]').val();
var cc2 = $(' input#classNum_add').val();
var cc3 = $(' #classNum_add').val(); ☆ button .click无法绑定事件的解决:
<button type="button" class="dialogBtu_add"><i class="fa fa-save"></i>确认</button>
//$('button.dialogBtu_add').bind("click", dialogBtu_add); //不可以
//$("a.addManInfoBtn").bind("click", addAndUpdateLayer0());//不可以:刷新界面会自动 触发事件(art-template)!
$(document).on('click', '.dialogBtu_add', dialogBtu_add);// 可以