无法从插入的模式HTML中进行选择。dispatchBody不会选择或插入
success: function (response) {
var result = omac.getJson(response);
if (result.status.msg == "Success.") {var html = '<div class=\"modal right fade\" id=\"referenceModel\" tabindex=\"-1\" role=\"dialog\" aria-labelledby=\"myModalLabel\"> <div class=\"modal-dialog\" role=\"document\"> <div class=\"modal-content\"> <div class=\"modal-header\" style=\"background-color: #428bca;color:#fff;\"> <button type=\"button\" class=\"close\" id=\"btnCloseModel\" data-dismiss=\"modal\" aria-label=\"Close\"><span aria-hidden=\"true\">×<\/span><\/button> <h4 class=\"modal-title\" id=\"myModalLabel\">Reference Center<\/h4> <\/div> <div class=\"modal-body dispatchBody\"> <\/div> <div class=\"modal-footer\"> <button type=\"button\" class=\"btn btn-primary\" data-dismiss=\"modal\">CLOSE<\/button><\/div><\/div><\/div><\/div>';
$(html).after(".mainBody");
$('.dispatchBody').html(result.results.html);
}}
关于您要在此处执行的操作,我的猜测是:在.mainBody之后插入var html的内容,并将.dispatchBody的内容设置为返回的结果
这使您错误地使用.after,应该是
$(".mainBody").after(html);
有关after的详细信息,请参见http://api.jquery.com/after/
如果这不是您的意图,请更新您的问题以反映这一点。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句