Load part page with jQuery & AJAX

后端 未结 2 465
一个人的身影
一个人的身影 2021-02-08 13:26

I have a list of dynamic links on page A and a div where I wish to load content from another dynamically generated page B based on PHP variables.



        
相关标签:
2条回答
  • 2021-02-08 13:32

    Checkout jQuery .load() method.

    0 讨论(0)
  • 2021-02-08 13:45

    You could use .load as in

    $("#ajaxContent").load($(this).attr("href") + " #named-div");
    

    Otherwise, parse the response yourself:

    $("#ajaxContent").html($(response).find("#named-div"));
    
    0 讨论(0)
提交回复
热议问题