Last active
March 17, 2023 11:17
-
-
Save mahammad/e59403df8b4f908316fc77533fd2b05b 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
<script type="text/javascript"> | |
$.ajaxSetup({ | |
headers: { | |
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | |
} | |
}); | |
$('form').on('submit',function(e){ | |
e.preventDefault(); | |
$.ajax({ | |
type:'POST', | |
url:'', // endpoint {{ route('test') }} | |
headers: { | |
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') | |
}, | |
data: { | |
// data key valular | |
}, | |
success:function(data){ | |
alert(data.success); | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment