I provide many actions on my site with AJAX. For example; sending a form data, any button and etc. All these movements are in the Javascript file.
$.ajax({
type: "GET",
url: RootAddress + "/spine.php",
data: "example=" + $exampleData,
dataType: "json",
cache: false,
success: function (data) {
/* ... */
},
error: function (xhr, textStatus, errorThrown) {
/* ... */
}
There are dozens of codes similar to the code above in a my javascript file, my JS file looks like it’s a loop. I need to create this AJAX code for each transaction. How do sites with large projects work? I think there is a method for this. It should not be like this…
Therefore I searched in the Github & GitLab site for method, but couldn’t find a useful repository.
How do you use your projects?