jQuery an ajax instance
Oct 11, 2017 am 09:07 AMPremise: AppServ has been installed on the computer
The code is as follows:
For the first page, only write HTML code:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>第一个ajax</title> </head> <body> <p class="comment"> <h6>zhangsan:</h6> <p class="para">soft</p> </p> <p class="comment"> <h6>李四:</h6> <p class="para">板凳</p> </p> <p class="comment"> <h6>王五:</h6> <p class="para">地板</p> </p> </p> <script src="../libs/jquery.js"></script> </body> </html>
For the second page, write jQuery Code
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>test</title> </head> <body> <input type="button" id="send" value="Ajax获取"> <p class="comment">已有评论:</p> <p id="resText"></p> <script src="../libs/jquery.js"></script> <script> $(function () { $("#send").click(function () { /* $("#resText").load("firstajax.html"); //将firstajax页面整个内容加在id为restext中*/ /* $("#resText").load("firstajax.html .para"); //将firstajax页面中class为para的内容加在restext中*/ }); }); </script> </body> </html>
The above is the detailed content of jQuery an ajax instance. For more information, please follow other related articles on the PHP Chinese website!

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to get variables from PHP method using Ajax?

How to use PUT request method in jQuery?

jQuery Tips: Quickly modify the text of all a tags on the page

PHP vs. Ajax: Solutions for creating dynamically loaded content

Use jQuery to modify the text content of all a tags

The relationship between the number of Oracle instances and database performance

PHP and Ajax: Ways to Improve Ajax Security

How to tell if a jQuery element has a specific attribute?
