Correction status:qualified
Teacher's comments:
学习越来越难,对于零基础的我来说,真的很吃力,有的时候就是在这硬撑,本次作业是$.ajax()的完整用法
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>3.$.ajax()</title> </head> <body> <h2>用户登录</h2> <form> <p>用户名:<input type="text" name="name"></p> </form> </body> </html> <script type="text/javascript" src="js/jquery.js"></script> <script type="text/javascript"> $(':input').blur(function(){ $.ajax({ url: 'api/demo.php', type: 'GET', data: $('form:first').serializeArray(), success: function(msg,status,xhr) { console.log(msg) $('p span').empty() $('p').append($(msg)) } }) </script>
点击 "运行实例" 按钮查看在线实例
php引用的是老师的代码
手写版