开发者

AJAX page fetch ignores javascript on page

I am calling an ajax script to fetch a content of a page and then replace the current contents with the fetched one. One problem I am facing is that there is a j开发者_StackOverflowavascript on the fetched page which doesnt get rendered and is treated as text. How do I make sure that the javascript gets loaded?


write javascript(fetched page) code in main page.

for example:

$.ajax({
    url: "your fetched page url", 
    dataType: "html",
    type: 'POST',
    data: "your data", 
    success: function(data){ 
    $("#result").html(data); //call back div
        //put your javascript code from fetched page here               
    }
});
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜