jQuery ajax load() javascript not executing?

后端 未结 8 1116
执念已碎
执念已碎 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条回答
  •  再見小時候
    2020-11-29 08:11

    Juhu. I've solved it. Don't know wheather this is the most elegant way but it works :)

    jpsilvashy your getscript(); has done it :) I've included these two lines in my content which should be loaded:

    
    

    that works.

    For everyone who has the same problem there's a small hint. You should delete the body and head tags. If they are included it doesn't work.

    But now there's still a question: Why do i need to include this in the loaded content? I think the JavaScript has to be loaded after the content was loaded into the dom.

    But that only some assumption!

    Thanks for your great help!

提交回复
热议问题