编辑: 我的剧本是由一个按钮叫:$("#btnLogout").click(function() { the ajax here
jQuery的什么是错的这个功能
我一想,如果有什么不对的:
$.ajax({
contentType: "application/json; charset=utf-8",
data: {"fname":"123456"},
dataType: "json",
type: "POST",
//url: "PersonService.asmx/AddPerson"
url: "http://mark:[email protected]/users/145198/users/update"
});
它接缝不工作,我没有得到任何错误,所以我可以看到有什么不对。
我想从我的价值从数据库中data
感谢
好吧, 更改记录,我发现我的回答与arma's
帮助。 的type: "PUT",
命令修改的东西。 的type: "POST",
命令是用于创建/加入的东西。
var mydata = {"fname":"bobworth"};
$.ajax({
type: "PUT",
processData : false,
data: JSON.stringify(mydata),
dataType: "json",
url: "http://www.xxx.com/users/",
contentType: "application/json; charset=utf-8",
username: "mark",
password: "123456",
success: function(t){ alert(t); },
error: function(jqXHR, textStatus, error){
alert("jqXHR:"+jqXHR.status+" txtStatus:"+textStatus+" Error:"+error); }
});
感谢大家。
是否使用[萤火虫](http://getfirebug.com/)? – Orbling 2011-04-06 22:45:07