前提:电脑上已经安装了appserv
代码如下:
第一个页面,只写HTML代码:
html> <meta> <title>第一个ajax</title><p> </p><h6>zhangsan:</h6> <p>soft</p> <p> </p><h6>李四:</h6> <p>板凳</p> <p> </p><h6>王五:</h6> <p>地板</p><div class="aritcle_card flexRow artxards"> <div class="artcardd flexRow"> <a class="aritcle_card_img" rel="nofollow" href="/xiazai/gongju/2331" title="jQuery 1.12.4"><img src="https://img.php.cn/upload/manual/001/431/639/6a21619eac924328.png" alt="jQuery 1.12.4" onerror="this.onerror='';this.src='/static/lhimages/moren/morentu.png'" ></a> <div class="aritcle_card_info flexColumn"> <a rel="nofollow" href="/xiazai/gongju/2331" title="jQuery 1.12.4" class="overflowclass">jQuery 1.12.4</a> <p class="overflowclass">jQuery 1.12.4是jQuery 1.x系列的最后一个正式稳定版本,由jQuery团队于2016年发布。该版本主要面向需要兼容旧版浏览器环境的网站和Web应用,尤其适用于仍需支持Internet Explorer 6、Internet Explorer 7、Internet Explorer 8等老旧浏览器的项目。</p> </div> <a rel="nofollow" href="/xiazai/gongju/2331" title="jQuery 1.12.4" class="aritcle_card_btn flexRow flexcenter"><b></b><span>下载</span> </a> </div> </div> <script></script>
第二个页面,写jQuery代码
html>
<meta>
<title>test</title><input><p>已有评论:</p>
<p></p>
<script></script><script>
$(function () {
$("#send").click(function () {
/* $("#resText").load("firstajax.html"); //将firstajax页面整个内容加在id为restext中*/
/* $("#resText").load("firstajax.html .para"); //将firstajax页面中class为para的内容加在restext中*/
});
});
</script>










