I have used this code for ajax pagiantion

JS file -

document.getElementById('divname').innerHTML = content;
ajax.callPage("URL"+str, ajaxSearchFilter);

	tb_init('a.thickbox, area.thickbox, input.thickbox');//pass where to apply thickbox
	imgLoader = new Image();// preload image
	imgLoader.src = tb_pathToImage;

Php file -

<td colspan="2" align="center">
		<?php				

		if($page != 1)
		{ 
			$pageno=$_GET['page'];
			$pageprev = $pageno-1;
			if($_GET['city_name'] != "")
			{
				echo("<a href=\"#namespace\" onclick=\"javascript:pageFilter('var&page=$pageprev');\">Prev</a>&nbsp; ");
				
			}				
		}
		$numofpages = $total / $rec_per_page; 
		
		for($i = 1; $i <= $numofpages; $i++)
		{
			if($i == $page)
			{
				echo($i." ");
			}
			else
			{
				if($_GET['city_name'] != "")
				{
					echo("<a href=\"#namespace\" onclick=\"javascript:pageFilter('var&page=$i');\">$i</a> ");
				}			
			}
		}

		if(($total % $rec_per_page) != 0)
		{
			if($i == $page)
			{
				echo($i." ");
			}
			else
			{
				if($_GET['city_name'] != "")
				{
					echo("<a href=\"#namespace\" onclick=\"javascript:pageFilter('var&page=$i');\">$i</a> ");		
				}				
			}
		}
			
		if(($total - ($rec_per_page * $page)) > 0)
		{
			 if($_GET['page'] == "" or $pageno == "")
				$pageno= 1;  
							
			 $pagenext = $pageno+1;
			 if($_GET['city_name'] != "")
			 {
				echo("&nbsp;<a href=\"#namespace\" onclick=\"javascript:pageFilter('var&flag=0&page=$pagenext');\">Next</a>"); 				
			 }			
		}									
		
		?>
	
	</td>

but i m not getting right result for that.it seems to be for any pagination digit click it not doing anything.can anyone help me out?:(

If you hard-code a link does it work?

<a href="#namespace" onclick="pageFilter('var&page=1');">1</a>

If not, then check that pageFilter is being called correctly and that "#namespace" is correct.

Airshow

This article has been dead for over six months. Start a new discussion instead.