即使DOM发生变化,也要匹配元素

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了即使DOM发生变化,也要匹配元素相关的知识,希望对你有一定的参考价值。

If you want to trigger an event on an matched element and that element may be introduced into the DOM from an Ajax request, you can still match against it by using the livequery plugin and the following code.
  1. $('.myClassToMatchAgainst').livequery(function(event) {
  2. //do this
  3. });

以上是关于即使DOM发生变化,也要匹配元素的主要内容,如果未能解决你的问题,请参考以下文章