Loading scripts dynamically

后端 未结 5 1636
青春惊慌失措
青春惊慌失措 2020-12-09 23:35

I\'m loading a few YUI scripts dynamically in my code in response to an Ajax request. The DOM and the page is fully loaded when the request is made - it\'s a response for an

5条回答
  •  一个人的身影
    2020-12-10 00:12

    You could use a setTimeout() to run some function that just checks if it's loaded - check something like

    if (typeof YUI_NAMESPACED_THING !== "undefined") runCode()

    EDIT Thanks, CMS

提交回复
热议问题