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
繁花如伊
随时随地看视频慕课网APP
相关分类