Blogger Information
Blog 42
fans 0
comment 1
visits 25897
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
$.ajax()的用法学习-2018年4月11日上午9:50完成
邵军-山东-84918的博客
Original
515 people have browsed it

代码如下:

实例

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8" />
    <title>作业</title>
    <script src="http://cdn.static.runoob.com/libs/jquery/1.10.2/jquery.min.js"></script>
    <script type="text/javascript">
    $(function() {
        $(':input').blur(function() {
            $.ajax({
                url: 'api/demo.php',
                type: 'GET',
                data: $('form').eq(0).serializeArray(),
                success: function(msg, status, xhr) {
                    $('p span').empty()
                    $('p').append($(msg))
                }
            })

        })
    })
    </script>
</head>

<body>
    <h2>用户注册</h2>
    <form>
        <p>用户名:
            <input type="text" name="name">
        </p>
    </form>
</body>

</html>

运行实例 »

点击 "运行实例" 按钮查看在线实例

IMG_20180411_094735_看图王.jpg

Correction status:Uncorrected

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post