Một ví dụ sử dụng jQuery load và php (ok)

C:\xampp\htdocs\wpclidemo\load.php

<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script>
$(document).ready(function(){
  $("button").click(function(){
    $("#div1").load("demo_test.php");
  });
});
</script>
</head>
<body>
	<button>Get External Content</button>
	<div id="div1"></div>
</body>
</html>

C:\xampp\htdocs\wpclidemo\demo_test.php

<h2>jQuery and AJAX is FUN!</h2>
<p id="p1">This is some text in a paragraph.</p>

Last updated