jquery 1.9.0 live function?

后端 未结 4 1207
迷失自我
迷失自我 2020-12-06 05:56

There is no live() function in jquery 1.9.0, but jquery.unobtrusive.ajax.js is already use this function.

Should I us

4条回答
  •  我在风中等你
    2020-12-06 06:26

    .live() has been replaced with the event delegation syntax of .on():

    $('#parent').on('click', '.child', function() {
      ...
    });
    

    #parent should exist when you call your selector, so if your element is top-level, use document as the parent.

提交回复
热议问题