javascript or jQuery doesn't work in dynamically generated content

后端 未结 4 1238
孤城傲影
孤城傲影 2020-12-06 14:28

Morning people. How to make my javascript or jquery works in dynamically generated content.

Basically, i have created web page that generates contents, base on wha

4条回答
  •  被撕碎了的回忆
    2020-12-06 15:04

    You need to use live event.

    As an example, if your generated content contain a click event, you could do this:

    $(".something").live("click", function({ 
    // do something
    )};
    

提交回复
热议问题