PHP Classes

File: ajaxPaging.js

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in Bookmark in
  Classes of Developer CK  >  PHP AJAX Paging Class  >  ajaxPaging.js  >  Download  
File: ajaxPaging.js
Role: Auxiliary data
Content type: text/plain
Description: javascript For ajax
Class: PHP AJAX Paging Class
Display pagination links updated using AJAX
Author: By
Last change:
Date: 2 years ago
Size: 1,551 bytes


Class file image Download
 * @version 1.0
 * @author CK
 * @date 22-Feb-2013
 * @desc this javascript function  is used to show a dynamic list has paging.
 * 		 e.g: You have a list of 100 record and you fetch that through
 * 				ajax but now you want to show these records by paging

//----------------you need  jquery for this 

$(document).ajaxStart(function() {

$(document).ajaxStop(function() {

	$(document).ajaxError(function() {
	 alert('Some Error Occurred!');
function ajaxPaging(pagename,page,extra,div)
 	var htmlContent='';
 	var divSelector='#'+div;
 	//-----------------on ajax Start
	$(divSelector).ajaxStart(function() {	
	 	 $(this).text('loading....'); //you can customize these function to give better effect
	//----------------on ajax stop 
	$(divSelector).ajaxStop(function() {	
	   	$(this).text('');  //you can customize these function to give better effect
 	//----------call start
	   type: "POST",
	   url: pagename,
	   data: 'page='+ page+'&extra='+extra,
	   cache: false,
	   async: false,
	   success: function(response){	   
	//-----------------on ajax Success 
	$(divSelector).ajaxSuccess(function() {		
	//-----------------on ajax Error
	$(divSelector).ajaxError(function() {
	 	alert('Some Error Occurred!');