且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

JavaScript在DIV中动态加载脚本

更新时间:2023-12-04 23:38:40

按照我的理解,您的代码不会等到DOM准备就绪.

The way i understand it, your code does not wait till the DOM is ready.

建议使用jquery的就绪,这将确保传递给它的脚本仅在DOM准备就绪

It is advised to use jquery's ready which will ensure that the script passed to it runs only after the DOM is ready

希望这会有所帮助