tags:

views:

112

answers:

4

Hello, I have created one .html page. I have to use pagination in it so that i can avoid scrolling upto last page.and i can move to next page by click on button("Next")

A: 

You can create a form like this:

<form action="nextpage.html" method="get">
<input type="submit" value="Next" />
</form>

That will give you a form with a button that redirects the user to the page nextpage.html

jao
or just use a simple link `<a href="nextpage.htm" title="go to next page">next</a>`
knittl
Thanks Jao for suggestion
om
He wanted a button, therefore I suggested a form
jao
A: 

You can do that with PHP. With PHP, you can dynamcally generate HTML pages, in this case with a certain amount of items on it and links to the next and previous page.

eWolf
OK, you don't have to, you can also manually create an HTML file for each page, but that is pretty complex and unflexible.
eWolf
Thanks eWolf for help
om
And you can do it with python and ruby(onrails) and ... , even ajax can do this. Also one long document with internal links could do the trick.
DaClown
Yes I know, but PHP is probably the most common and most available language of these (I don't say it's the best!).
eWolf
I'm just saying your "have to" is simply wrong, PHP is only one possiblity among many other server side script languages. But even SSI can do it, and client side script languages, too.
DaClown
I'm sorry, I changed it.
eWolf
This solution is good only when you know about amount of pages, while generating HTML, but what if you need paginate after some AJAX request came back?
Artem Barger
Of course when you do AJAX requests and modify the content with javascript, you re-paginate with javascript. But this is just additional, your website should work without JS, too.
eWolf
A: 

Assuming you are looking for a way to implement pagination, take a look at this jquery plugin. And I believe you will find a tons more plugins across the web.

Artem Barger
Thanks Artem Barger for help.
om
Welcome, just doubted who has downvoted all answers and why?
Artem Barger
A: 

Use Jquery Pager

You can find its Demo here.

Mahin
but how to do that ?
om
This is only a javascript solutions, which means, it will not work in case the client has disabled javascript.
eWolf