Category : Ajax


Codeigniter 3 - select2 ajax autocomplete from database example with demo

Today, I am going to show you how to make select2 dynamic autocomplete from database table in your Codeigniter application. In this post you can lean how to implement ajax autocomplete in your Codeigniter 3 project. Select2 is a Jquery plugin and it is a very famous jquery plugin, using select2 plugin we can do several thing like select box with search, select option with check box, ajax auto-complete etc. sometimes we require to do autocomplete task with select box when we have large amount of data like products, items, category, tags, users etc. so we can't load all the data at the same ti.....

By Hardik Savani | September 15, 2016 | | 7215 Viewer | Category : Ajax
READ MORE

How to implement infinite ajax scroll pagination in Laravel 5?

We always want to see auto load more data on page scroll on your home page or other pages for posts, news, listing etc like on facebook, twitter, linkedin etc. If you implemented infinite scroll on your php application then you don't require to give pagination and also not require to page refresh every time when page scroll. So, Today, i going to give you simple example of infinite scroll using jquery ajax on page scroll in laravel application from scratch. I use jquery scroll event for page scroll. this example is pretty simple, you can customize simply for your development. You have to jus.....

By Hardik Savani | August 23, 2016 | | 7431 Viewer | Category : Ajax
READ MORE

How to make simple dependent dropdown using jquery ajax in Laravel 5?

In this tutorial, I am going to do a simple dependent drop down list in Laravel 5 application using jquery ajax. In this simple example through we understand how to work dependent dropdown in laravel even if you beginner. We sometimes require to make dependent dropdown like when state select at that time bellow city drop down list should change, i mean related to selected state. In this example i have two tables and there are listed bellow: <strong>1.demo_state</strong> <strong>2.demo_cities</strong> So, when user will change state at that time, dynamically change city drop down box from data.....

By Hardik Savani | August 16, 2016 | | 8734 Viewer | Category : Ajax
READ MORE

How to check request is Ajax or not in Laravel 5?

Sometimes, we need to check request is ajax or not in laravel 5. If you want to call same method but if request is ajax then you perform different, then you can do by using $request object. In Laravel 5 $request object provide method to check request is ajax or not, In following example you can see how it's works. You can check directly from Request facade and also from request object, both are same, so let's see bellow example. <strong>Example 1:</strong> <pre class="prettyprint lang-php"> public function index(Request $request) { if($request->ajax()){ return response()->json([.....

By Hardik Savani | August 13, 2016 | | 1838 Viewer | Category : Ajax
READ MORE

Jquery select2 ajax autocomplete example with demo in PHP

Jquery select2 plugin is a very famous jquery plugin, using select2 plugin we can do several thing like select box with search, select option with check box, ajax auto-complete etc. We normally require to do autocomplete task with select box when we have large amount of data like products, items, category, tag, user etc. so we can't load all then data at time and it's hard to find that item from several records. So select2 plugin provides us with select box with search and Ajax dynamically auto complete that way page will never load more and it will work fine. In this example, I have two fil.....

By Hardik Savani | August 5, 2016 | | 10461 Viewer | Category : Ajax
READ MORE

JQuery - Display loading image on ajax call example

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. <strong class="example">Example:</strong> <pre class="prettyprint lang-js"> <script type="text/javascript"> $(document).ready(function() { $(document).ajaxStart(function(){ $('#process_img').cs.....

By Hardik Savani | April 12, 2016 | | 1199 Viewer | Category : Ajax
READ MORE

Jquery ajax request example

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. <strong class="example">Example:</strong> <pre class="prettyprint lang-php"> <html lang="en"> <head> <title>JQuery Ajax Demo</title> <script src="http://cdnjs.cloudflare.com/ajax/lib.....

By Hardik Savani | April 10, 2016 | | 1100 Viewer | Category : Ajax
READ MORE

How to parse json in jquery ajax?

When you are working php or .net etc and you return data like json_encode($data) on ajax request. but in front side you get like a string at that time you have to parse json object and get them. so, let's see example and learn how to use: <strong class="example">Example</strong> <pre class="prettyprint lang-php"> var request = $.ajax({ type: 'POST', dataType: 'json', url: 'http://www.mysite.com/getpostuser', data: {token:obj['token'],postid: obj['postid']} }); request.done(function(msg) { msg = JSON.parse(msg); msg.forEach(function(items) { var e = "notify-"+items.userid; .....

By Hardik Savani | April 5, 2016 | | 936 Viewer | Category : Ajax
READ MORE

Laravel 5.2 API using JWT authentication tutorial from scratch example

In this post i want to share you how to create API in Laravel 5.2 with using JWT, If you are beginner then It is a very simple way to create and it is pretty easy to undestand how to create API. After this you can make more secure and complex your API. you can learn JWT authentication from back-end side. we have to learn how to works API from front-end and back-end side. i give you both side fully example how it works and use. <img width="100%" src="/upload/laravel-jwt.png" style="border:2px solid cadetblue"> JWT stand for Json Web Token. JWT will helps to create authentication and connect fro.....

By Hardik Savani | March 31, 2016 | | 24809 Viewer | Category : Ajax
READ MORE

Ajax - Cross-Origin Request Blocked in Larave 5?

When i was working on my laravel 5 project and i was making backend API, i created successfully but when front-end developer call API which i made. It's return like: "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://learnl52.hd/register. (Reason: CORS header 'Access-Control-Allow-Origin' missing)." and i did try to how to solve this issue. I did also try with jquery and angularjs from backend but result nothing always. At last i did found how to solve this issue, i made one middleware that allows to Cross-Origin Request in your laravel appli.....

By Hardik Savani | March 30, 2016 | | 4717 Viewer | Category : Ajax
READ MORE

    Laravel 5.3 - import export csv and excel file into database

    Laravel 5.3 - import export csv and excel file into database

    Open Post

    Laravel 5 database backup using Laravel Backup Package

    Laravel 5 database backup using Laravel Backup Package

    Open Post

    How to add multiple markers in google map

    How to add multiple markers in google map

    Open Post

    Laravel 5 import export to excel and csv using maatwebsite example.

    Laravel 5 import export to excel and csv using maatwebsite example.

    Open Post

    How to get Instagram followers count using JQuery Ajax?

    How to get Instagram followers count using JQuery Ajax?

    Open Post

    Laravel 5 Google OAuth authentication using Socialite Package

    Laravel 5 Google OAuth authentication using Socialite Package

    Open Post