<a class="removeApp" data-app="12">Close Something </a>
$('.removeApp').click(function (e) {
$.ajax({
async: false,
type: 'POST',
url: '@Url.Action("Remove", "Something")',
data: {
id: $(this).data("app")
},
success: function (result, data) {
console.log(this.data); //gives id=12
console.log (this.data["id"]) ///gives nothing how do i get just 12
}
})
});
我试图获取通过参数名传递的数据我该如何做?获取通过Ajax调用成功后的参数值
您的数据来自哪里?你刚刚得到一个“id = 12”的字符串吗?在这种情况下,你需要解析字符串。 – 2013-02-17 21:38:37
from ancor data -app elements – 2013-02-17 21:43:06
你可以发布你正在发布的服务器方法吗? – glosrob 2013-02-17 21:56:00