jQuery ajax load() javascript not executing?

后端 未结 8 1120
执念已碎
执念已碎 2020-11-29 07:49

I\'ve read several posts about this issue but i can\'t solve it.

I am loading an html file into a div. The file i am loading contains a unordered list. This list sho

8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-11-29 08:21

    This solution works best. Using a callback function after the specific div or content container is loaded.

    $('#CONTAINER').load('URL_TO_LOAD HTML_ELEMENT_TO_PLUCK_FROM_PAGE_AND_INSERT_INTO_CONTAINER', function () {
        $.getScript('PATH_TO_SCRIPT_THAT_YOU_REQUIRE_FOR_LOADED_CONTENT');
    });
    

提交回复
热议问题