实例
<!DOCTYPE html> <!-- To change this license header, choose License Headers in Project Properties. To change this template file, choose Tools | Templates and open the template in the editor. --> <html> <head> <meta charset="UTF-8"> <title>0410</title> </head> <body> <h2>用户登录</h2> <form> <p>用户名:<input type="text" name="name"></p> </form> </body> <script src="js/jquery-1.8.0.min.js" type="text/javascript"></script> <script> $(':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> </html>
运行实例 »
点击 "运行实例" 按钮查看在线实例