jQuery发布JSON
var value
<form id="testForm" action="javascript:test()">
<code id="testArea"></code>
var formData = form2object('testForm');document.getElementById('testArea').innerHTML = JSON.stringify(formData, null, '\t'); var value = JSON.stringify(formData, null, '\t');
Submit Query
function authenticate(userName, password) { $.ajax ({ type: "POST", //the url where you want to sent the userName and password to url: 'username:password@link to the server/update', dataType: 'json', async: false, //json object to sent to the authentication url data: '{"userName": "' + userName + '", "password" : "' + password + '"}', success: function () { alert("Thanks!"); } })}
update or POST
慕码人8056858
繁花如伊
相关分类