在dbload.php
我写道:
<?php
class grid
{
function show()
{
echo"<div id = 'show'>";
if(isset( $_GET["Name"] ))
echo "done";
else
echo "Not done";
echo "</div>";
}
}
?>
在load.php
我写道:
<!DOCTYPE html>
<?php
include "dbload.php";
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="jquery-1.9.1.min.js"></script>
<script>
$(document).ready(function () {
$("a").click(function () {
$("div").load(this, function(){
alert("shod");
});
return false;
});
});
</script>
</head>
<body>
<a href="load.php?Name=mehdi"> click for load ajax</a>
<?php
$db = new grid();
$db->show();
?>
</body>
</html>
但我的加载功能不起作用。任何想法?