开发者

Creating "onload" functionality in Dynamic HTML

Using jquery ajax I populate contents of a div with HTML.

This new HTML data has javascript code (this part works correctly). However this javascrip开发者_开发问答t also has

$(document).load(function() { ... });

This part does not work since document is already loaded!

How should I handle this?


Are you sure it's always going to be loaded via AJAX? If so, why not just remove the $(document).load() altogether?


Nothing fancy is actually needed. It seems that dynamically loaded javascript is executed after the dynamic content is parsed by the browser.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜