SHARE
TWEET

Untitled

a guest Sep 22nd, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  <script>
  2.        
  3.         $(".checkbox").change(function(e){
  4.             console.log('clicked');
  5.            
  6.             e.preventDefault();
  7.            var id= $(this).attr("id");
  8.            var pid=$(".postid").attr("id");
  9.            $.ajax({
  10.                     url:'/update_member/'+pid+'/'+id,
  11.                     type:'POST',
  12.                     data:{ csrfmiddlewaretoken: "{{ csrf_token }}"},
  13.                     success:function(data){
  14.                         alert(data.data);
  15.                         if(data.truth){
  16.                             ($this).val=true
  17.                         }
  18.                         else{
  19.                             $(this).val=false
  20.                         }
  21.                     }
  22.         })
  23.     })
  24.     </script>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top