>[success] # 常用的$写法 >[danger] ##### get ~~~ function init(){ $.ajax({ url:"/index.html", type:"GET", dataType:"JSON", success:function (arg) { console.log(arg.message) } }) } ~~~ >[danger] ##### post ~~~ function BindSumbit() { $('#btn').click( function () { $.ajax({ url:'/login.html', type:"POST", data:$("#fm").serialize(), dataType:'JSON', success:function (arg) { if(arg.status){ window.location.href="http://www.baidu.com" }else{ $('.us_error').text(arg.message.user[0]); $('.pw_error').text(arg.message.pwd[0]) } } }) } ) } ~~~