zoukankan      html  css  js  c++  java
  • ajaxform使用

    需要引入  jquery.form.js  jquery.js

    1.提交的表单

    <form id="myForm" action="comment.php" method="post"

        Name: <input type="text" name="name" /> 
        Comment: <textarea name="comment"></textarea> 
        <input type="submit" value="Submit Comment" /> 
    </form>



    2.
    ajaxForm调用,会把name属性的值提交上去


    <html
    <head
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.js"></script> 
        <script src="http://malsup.github.com/jquery.form.js"></script> 
     
        <script
            // wait for the DOM to be loaded 
            $(document).ready(function() { 
                // bind 'myForm' and provide a simple callback function 
                $('#myForm').ajaxForm(function() { 
                    alert("Thank you for your comment!"); 
                }); 
            }); 
        </script> 
    </head> 

    官方网址:http://malsup.com/jquery/form/
  • 相关阅读:
    Spring Boot自动配置
    Servlet、JSP总结(1)
    Spring MVC
    Springboot中的数据库事务
    数据库访问
    AOP
    全注解下的IOC
    spring boot入门
    安卓工程化开发笔记(2)
    2048功能说明模板
  • 原文地址:https://www.cnblogs.com/ldybyz/p/5940953.html
Copyright © 2011-2022 走看看