Tag Archives: ajax

Codeigniter: Implement ajax request with json and html response

Implementing ajax request with JSON and HTML response is quite simple as we don’t need to keep in mind to disable layout like in other frameworks. Assuming that the ajax code already exists using your preferred java-script library. Ajax request with JSON response: In controller action that hit with ajax request for JSON response, you… Read More »

Javascript: Advantages and Disadvantages of Ajax

Hello friends, Here we shall discuss about some advantages and disadvantages of using AJAX. Advantages of ajax: #1) Almost supports all modern browsers #2) Reduce the traffic travels between the client and the server. #3) Response time is faster so increases performance and speed. #4) Many open source javaScript libraries available for ajax support like… Read More »

Zend Framework 2 – Ajax Pagination and Records Sorting

In any application, record listing with pagination and sorting is very common thing. ZF2 also provides support for pagination. Lets start with an example to understand the concept more clearly. Step 1: Create a database table countries and states

Step 2: Now create database configuration

Step 3: Lets create a new module “Sample”… Read More »

Zend Framework 2 : Perform ajax request

Step 1 : Include jquery.js file in layout.phtml Step 2 : Create Contorller JavascriptController.php in /path/to/yourapp/module/Application/src/Application/Controller/

Step 3 : Create a javascript file ajax.js in /public/js/modules/javascript/ajax.js

Step 4 : Create index.phtml in /path/to/yourapp/module/Application/view/application/jsvascript/index.phtml

Step 5 : Finally, in /path/to/yourapp/module/Application/comfig/module.config.php file add following code in [view_manager] to support ajax requests