<!DOCTYPE html>
<html>
<head>
<  http-equiv="Content-Type" content="text/html; charset=utf-8"/>
< >My Test JQuery</ >
    <  type="text/ " src="./js/jquery-1.10.2.min.js"></ >
    <  type="text/ " >    
        $(function(){
            personObj=new  ();
            personObj.name="xiaohuzi";
            personObj.age=26;
            personObj.web="xiaohuzi.test.com"; 
            //语法格式:$.param( ,trad)
            // : 必需参数。规定要序列化的数组或对象。
            //trad: 可选参数。布尔值,指定是否使用参数序列化的传统样式。
            $("#btn_ajax").click(function(){
                $("#myDiv1").text($.param(personObj));
            });
        });
    </ >
</head>
<body>
    <button type="button" id="btn_ajax">ajax</button>
    <div id="myDiv1" style="height:30px;padding: 10px;border:2px solid blue;">
    </div>   
</body>
</html>
收藏 打印