无法在iframe中触发表分类器

Unable to trigger tablesorter in iframe

本文关键字:分类器 iframe      更新时间:2023-09-26

我试图从iframe中删除表分类器中的一行,我成功地删除了,但我无法触发更新表分类器。这就是我正在尝试的

$(document).ready(function () {
    var uid = ". json_encode($_POST['uid']) . ";
    var access = " . json_encode($_POST['access']) . ";
    if(access == '1') {
     top.$('#content').contents().find('#orgs tr[data-uid='+uid+']').remove();
      top.$('#content').contents().find('#orgs').trigger('update');
      console.log(top.$('#content').contents().find('#orgs'));
    }
    top.$.fancybox.close();
});

我不明白我是否能够删除一行,也可以在console.log中删除它,但为什么不触发更新,但我试图用这个$('#orgs').trigger('update');在同一个iframe中触发,然后它就可以工作了

访问父窗口时不要使用jQuery的.contents()

if (access == '1') {
  top.$('#content').find('#orgs tr[data-uid='+uid+']').remove();
  top.$('#content').find('#orgs').trigger('update');
  console.log(top.$('#content').find('#orgs'));
}