jquery append external html file into my page

后端 未结 5 481
长发绾君心
长发绾君心 2020-12-02 14:48

I\'m trying to append an external html content (div plus some text inside just for testing) this way:

$.get(\"banner.html\", function(data){
    $(this).chil         


        
5条回答
  •  温柔的废话
    2020-12-02 15:11

    Use html instead of append:

    $.get("banner.html", function(data){
        $(this).children("div:first").html(data);
    });
    

提交回复
热议问题