How can I use jQuery.load to replace a div including the div

前端 未结 13 1662
半阙折子戏
半阙折子戏 2020-11-27 14:40

I have a div with the id of \"secondHeader\" and I want to replace that entire div with another div with the same id of \"secondHeader\" but instead of replacing it , it jus

13条回答
  •  误落风尘
    2020-11-27 15:21

    I had this issue as well, but I was able to use .load by restructuring the code like so: (jade)

    div#view
       div.content
          block content
    

    and the script like so...

    $("#view").load( $(this).attr("href") + " div.content" )
    

    so target the child instead of the same tag.

提交回复
热议问题