JS solution for static news Paging

Source: Internet
Author: User
Today, I saw a news website that used js to read the content string (the XML node content here) for post-processing. The page was divided by custom words, in addition, you can click to display all (that is, do not browse by PAGE)
View its Source code Later, I proposed this basic method, which is very good. Let's take a rough look at the method called at the front end and the points of attention: 1 < Div ID = "Article" > <! -- Display area of the body content (it must be retained. This ID is used by the background JS Program) --> </ Div >
2 < XML ID = "Xmlarticle" >
3 < Article >
4 < Info >
5 < Content >
6 <! [CDATA [
7 <Font face = verdana > < Font Face = Verdana > Here is the news content. (The xml id here is also used in the content node backend and retained) </ Font > ]>
8 </ Content >
9 </ Info >
10 </ Article >
11 </ XML >
12 < Script Type = "Text/JavaScript" >
13 // Number of words displayed per page
14 Pagesize = 800 ;
15 // Paging Mode
16 Flag = 1 ;
17 </ Script >
18 <! -- Body paging JS -->
19 < Script Type = "Text/JavaScript" SRC = "Cutarticle. js" > </ Script >
20 < Script Type = "Text/JavaScript" >
21Text_pagination (1);
22 </ Script >  

attachment: Download cutarticle. js

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.