标签:style blog java 使用 os io 2014 for
在项目中可能会碰到这样的几个问题:前端代码:
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <script type="text/javascript" src="jquery-1.8.3.js"></script> <script type="text/javascript"> $(function(){ $("#serializeForm").click(function(event){ $("#content").val($("form").serialize()); }); $("#serializeChecked").click(function(event){ $("#content").val($(":checkbox,:radio,:password").serialize()); }); $("#testParam").click(function(event){ $("#content").val($.param({name:'ziwen',address:'address'})); }); $("#serializeArray").click(function(event){ $("#content").val($("form").serializeArray()); }); }); </script> </head> <body> <textarea rows="5" cols="30" id="content"></textarea> <form action="#"> <label for="name">name:</label><input type="text" name="name"><br> <label for="password">password:</label><input type="password" name="password"><br> <label for="yesOrNo">yesOrNo:</label><input type="checkbox" name="yesOrNo"><br> <label for="sex">sex:</label> <input type="radio" name="sex" value="0"> <input type="radio" name="sex" value="0"><br> <input type="button" id="serializeForm" value="serializeForm"> <input type="button" id="serializeChecked" value="serializeChecked"> <input type="button" id="serializeArray" value="serializeArray"> <input type="button" id="testParam" value="testParam"> </form> </body> </html>
jQuery_review之使用jQuery的Ajax必须知道的,serialize、param方法以及全局函数,布布扣,bubuko.com
jQuery_review之使用jQuery的Ajax必须知道的,serialize、param方法以及全局函数
标签:style blog java 使用 os io 2014 for
原文地址:http://blog.csdn.net/ziwen00/article/details/38199589