Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- $(".checkbox").change(function(e){
- console.log('clicked');
- e.preventDefault();
- var id= $(this).attr("id");
- var pid=$(".postid").attr("id");
- $.ajax({
- url:'/update_member/'+pid+'/'+id,
- type:'POST',
- data:{ csrfmiddlewaretoken: "{{ csrf_token }}"},
- success:function(data){
- alert(data.data);
- if(data.truth){
- ($this).val=true
- }
- else{
- $(this).val=false
- }
- }
- })
- })
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement