<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 호출 성공 후 Param 값을 전달하십시오.
데이터의 출처는 어디입니까? "id = 12"인'String'을 얻고 있습니까? 어떤 경우에는 문자열을 구문 분석해야합니다. –
ancor 데이터에서 - app 요소 –
게시 할 서버 메소드를 게시 할 수 있습니까? – glosrob