Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Write sample code for pagination using java script.

Answer Posted / sonylal

To use my javascript you need to:

1. include the javascript using <script src="pager.js">
in your page header;
2. include a small css to skin the page navigation-bar
(i.e. for emphasizing the selected page using bold and
underline style);
3. define an ID on the table you want to scroll. i.e.
<table id="results"> ;
4. place an empty <div/> in the place you want to display
the navigation bar. i.e. <div id="pageNavPosition"> ;
5. include an initialization script at the bottom of your
page like this:

<script type="text/javascript"><!--
var pager = new Pager('results', 3);
pager.init();
pager.showPageNav('pager', 'pageNavPosition');
pager.showPage(1);
//--></script>

Where 'results' is the id of the table (see step #3), 3 is
the number of records per page, 'pager' is the name of the
variable (in red... that's ugly I agree...), and
pageNavPosition is the ID of the DIV inside of which the
pagination bar will be placed. The showPage(1) indicates
that, when loading the page, the 1st one should be displayed.


Regards
www.jobpuja.com

Is This Answer Correct ?    47 Yes 28 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between the operators '==' and '==='?

946


What makes something a function?

883


what is function of stdio.h

2436


Is javascript pure object oriented?

810


How do I unblock javascript in chrome?

941


Why global variables are bad javascript?

924


How to get value from dropdown (select) control?

1009


What does the delete operator do?

892


How to replace all occurrences of a string in JavaScript?

1041


Explain hoisting in javascript?

1010


What is the difference between innerhtml & innertext?

830


How to convert a string to a number using javascript?

963


What is a noscript tag?

792


What is unobtrusive javascript? How to add behavior to an element using javascript?

928


How do I save javascript?

906