Today, I am going to show you How to image or file upload using jquery Ajax in our Laravel application. In this tutorial i explain step by step example code of ajax image upload using jquery form JS.
As you know today, we have basic feature image or file uploading(<a href="http://itsolutionstuff.com/post/laravel-53-image-upload-with-validation-exampleexample.html" target="_blank">Laravel 5.3 Image Upload with Validation example</a>) on our PHP Project Or Laravel application. Client always want to store image for profile, products, items, users etc. Laravel provide very simple way to store tha.....
Sometimes, we want to display loading image or animation or text when fire every ajax request. In not for only one ajax request, but if you want to load image on every ajax request then you can do that using bellow example.
I use ajaxStart() and ajaxComplete() function for show image until All POST or GET Ajax request. this both function will execute one each $.ajax request.
<pre class="prettyprint lang-js">
If you are very fresher in jquery and you don't know how to work post ajax request then bellow example can help you. i gave you the example of POST ajax request with json, you can also easily modify this example. you also fire GET ajax request using this example. bellow example is a pretty simple to undestand how to work $.ajax method. so let's see bellow example and try to undestand.
<pre class="prettyprint lang-php">
<title>JQuery Ajax Demo</title>