无论选择器的隐含程度如何,jQuery 是否都无法识别或选择锚标记?最近对 wordpress 的更新似乎使我的(管理员)模式窗口锚标记对我编写的任何脚本都不可见。
<a href="#TB_inline?width=600&height=550&inlineId=ss-edit-image-box" data-id="6285" id="6285" title="Edit Individual Image Info" class="edit-image thickbox prettylink" style="display: inline;">» Edit 6285</a>
那是一个模态窗口链接。单击它会显示模态窗口。这实际上有效。
但是让ajax“发布”并没有发生。似乎我尝试按其类别选择锚标记仍然没有给出任何东西。
//get_image_ajax
$(document).on('click', '.edit-image', function (e) {
e.preventDefault();
var data = {
action: 'ss_professional_ajax',
security: '<?php echo $ajax_nonce; ?>',
image_id: $(this).attr('id'),
};
$.post(ajaxurl, data, function (response) {
$('#ss-edit-image-box-content').empty();
$('#' + loading_icon).show();
$('#ss-edit-image-box-content').append(response);
$('#' + loading_icon).hide();
});
return false;
});
重要的是要注意这个问题发生在 wordpress 3.6 更新中。在一切都很好之前。