I wrote beforeajax allows the returned content to be displayed in a specific divI was looking at jquery recently, so I re-wrote it using jquery. jquery really means "write less, do more"
<html> <head> <title></title> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.1.min.js"></script> <meta charset="utf-8" /> <script> $(function(){ $("#right").load("test1.php"); $("#left").click(function(){ $("#right").load("test2.php"); return false;//禁止按钮提交 }); }); </script> </head> <body> <div id="left"><a href="#">点击这里</a></div> <hr /> <div id="right"></div> </body> </html>