Using JS script to implement the link

Source: Internet
Author: User

When using JSON to implement paging, it is very simple to extend how to use the JS reality link, but I have not used it before.

For example, on the previous page of the page, the next page:

<script type= "Text/javascript" >varpage=1;//the current page number valuefunctionfun1 (type) {//Generate page Number values        if(type== ' pre ') {page=page-1; if(page<1) {page=1; }        }Else if(type== ' Next ') {page=page+1; }Else{page=1; }}</script><div id= "page" ><a href= "javascript:fun1 (' pre ')" > Previous </a>&nbsp;<a href= "javascript:fun1 (' Next ')" > Next </a></div>

Of course, we still follow the principle of how to be simple ...

  

Using JS script to implement the link

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.