<script> $ (function () {//$ ("#send"). Click (function () {//$.get ("Jquery.ashx", {username: $ ("#username"). Val (), Content: $ ("#content"). Val ()}, function (msg) {//$ ("#resText"). HT ML (msg); // }); //}); $ ("#send"). Click (function () {$.post ("Jquery.ashx", {username: $ ("#username"). Val (), Content: $ ("#conten T "). Val ()}, function (msg) {$ (" #resText "). HTML (msg); }); }); }); </script><body> <form id= "Form1" action= "#" > <p> comments:</p> <p> Name: <INP UT type= "text" name= "username" id= "username"/></p> <p> content: <textarea name= "Content" id= "content" Rows= "2" cols= "></textarea></p> <p><input type=" button "name=" name "value=" Submit "id=" send "/></p> </form> <div class=" comment "> Comments </div> <div id= "ResText" > </div></body>
The second kind of
W3cschool.cchttp://www.w3cschool.cc/try/try.php?filename=tryajax_firstReproduced from
Http://www.cnblogs.com/dyxd/p/4261364.html
Ajax Simple Operation