Login   Register  
PHP Classes
elePHPant
Icontem

File: pagingajax.js

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Jannerel Roche  >  Paging Class with AJAX or HREF  >  pagingajax.js  >  Download  
File: pagingajax.js
Role: Auxiliary data
Content type: text/plain
Description: js file
Class: Paging Class with AJAX or HREF
Browse paginated query results using AJAX or HREF
Author: By
Last change: 1. now using jquery for ajaxification
2. added preloader div id for preloading purposes, make sure an element with id='preloader' exist in pagingindex.php
Date: 5 years ago
Size: 482 bytes
 

Contents

Class file image Download
/*
MAIN AJAX FUNCTION: xxmlhttprequest2()
*/


$(document).ready(function() {
	$("#preloader").hide();	
});

function xmlhttprequest2(id, url, methods, keyvalue) {
	
	$("#preloader").show();
	$.ajax({
 	 	type: "GET",
  		url: url+'?'+keyvalue,
  		success: function(html){
			$("#preloader").hide();
    		$("#"+id).empty().append(html);
			
  		},
		failure: function(html){
			$("#"+id).innerHTML = "Sorry, please try again..."
		}
		

	});
	
}