How to load a PHP page into a div with jQuery and AJAX?

后端 未结 6 605
名媛妹妹
名媛妹妹 2021-02-03 13:58

I am trying to write a function that will call getproduct.php?id=xxx when clicked. I can get the innerHTML portion to appear, but how do I also call t

6条回答
  •  滥情空心
    2021-02-03 14:58

    you can call or load php page inside a div using this line as :-

    $("#content_div").load("ajax/page_url.php");
    

    the "ajax/page_url.php" its a relative path of php file.

    so here you can replace it with external url as well.

    please share you knowledge if i am wrong.

提交回复
热议问题