Skip to content

Instantly share code, notes, and snippets.

@wpInam
Last active April 17, 2024 04:48
Show Gist options
  • Save wpInam/b94eee1c05344412a6064287d670f339 to your computer and use it in GitHub Desktop.
Save wpInam/b94eee1c05344412a6064287d670f339 to your computer and use it in GitHub Desktop.
Types Of Ajax Call
<!-- To check which are the pages index -->
site:lcm-calculator.com
<!--
data-formAction="{{ route('calculation', ['functionName'=> 'rootCalculator']) }}"
-->
<script>
var formData = { expr: inputVal, round: roundVal };
var url = $('.avc-calculator').attr('data-formAction');
$.ajax({
type: "POST",
url: url,
headers: { "X-CSRF-TOKEN": $('meta[name="_token"]').attr("content"), },
data: formData,
dataType: 'json',
timeout: 6000,
beforeSend: function () {
$('.loader-wrapper').fadeIn('slow')
},
success: function (data) { },
error: function (error) { },
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment