ZasieuN

Ajax

Oct 29th, 2018
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. $(document).ready(function(){
  2. var CSRF_TOKEN = $('meta[name="csrf-token"]').attr('content');
  3. $("#btn-store").click(function(e){
  4. e.preventDefault();
  5. $.ajax({
  6. url: '/storeFavorite',
  7. type: 'POST',
  8. data: {_token: CSRF_TOKEN, school_id:$("#school_id_store").val(), favorite:$("#favorite_store").val()},
  9. dataType: 'JSON',
  10. success: function (data) {
  11. window.location.reload();
  12. }
  13. });
  14. });
  15. });
Advertisement
Add Comment
Please, Sign In to add comment