Created
January 9, 2017 13:56
-
-
Save yevgnenll/cca4df3fa4cbd65ade5336672fc88e6e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('.comment-area').on('click', '.user_block' , function (event) { | |
var user_id = this.getAttribute("data-user-id"); | |
if(confirm('해당 user를 차단하시겠어요?')) { | |
$.ajax({ | |
'url': '/blocks/user/', | |
'type': 'POST', | |
'data': {'user': user_id}, | |
success: function (data, text, xhr) { | |
if(xhr.status === 201) { | |
} | |
console.log('success' ,data, text, xhr); | |
}, error: function (data, text, xhr) { | |
console.log('error' ,data, text, xhr); | |
} | |
}); | |
} | |
}); |
Author
yevgnenll
commented
Jan 9, 2017
- $('.comment-area') 는 1개 이상일경우
- .comment-area는 data-user-id를 가지고 있기 때문에 각각 가져와야해서 this를 사용해야할때
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment