JavaScript in built sites
 
 
Pagination is a built in function, in zero code created sites, which generates a paging ribbon. This ribbon displays the entire paging link at one shot, with out break. This utility is incorporated for all the auto and custom generated list, browseby templates.
 
New Features
 
This paging utility is modified in a new mechanism. The pagination utility can display a max of say 18 links at a time. If the total number of pages to be displayed exceeds the number (i.e. 18) then, the pagination function uses an internal algorithm, so as to accommodate all the pages in the form of a series of broken links with text boxes filling @ the breaks. The new ribbon looks as shown below.
 For example if the clicked number is  “14” And the Total Link is “44” then the link will be as shown below:  
e.g. (1)  12345812 13 14 15 1620242832364044 >
While the page is being loaded, if the total number of links is less than eighteen then those many number of pages with the clicked links will be displayed.
For e.g. (2),   < 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18  >
 
Maximum number of links to be displayed is 18. No matter how many ever pages are there, this functionality calculates the interval and helps to display all pages in a maximum of 18 links (by default the first link and the last link will always be displayed).
Another feature of this modified mechanism is that a text box is given for easy navigation to a particular page. For e.g in the above e.g1 link page number 22 is not displayed to the user. You can enter that page number in the text box and click the ‘go’ link, then that particular page is loaded.
The arrow on the left side of the links is displayed if the clicked page is not the first link. The arrow on the right end is displayed if the clicked page is not the last link.
When you click on the left side arrow, it takes the present clicked number, adds one to it, and  passes to the function to display the link. When you click on the arrow on the right side, one is subtracted from the clicked number and passed on to the function to display the respective link.
General Changes
Login to the Zerocode development environment. As you login you can see the banner on top, a menu frame on the left hand side and the list of site/s created by you on the right side (that is the main page). When you click on the site in which u wish to make changes, a tree structure is displayed in the left of the main frame, which contains folders with collection of htmlls and javascript files. Right now to get the pagination utility in the created site, our view of focus must be on list and browseby templates and the meta template, which create them.
Changes to be made in metaTemplate 
In a zeroCode-built site, the web server expects JavaScript files to be located in the …/webFiles/javaScript subdirectory of the site on the server. Upload the .js file into this directory (In this case it is the pagination.js). You have an upload button in the tool bar at the top, from which you can upload the pagination.js into the above-mentioned directory.
The next change is to the meta template, if the changes have to be reflected in all the auto generated Templates. The path will be <sitename>/metaTemplates. In this directory changes have to be done to the content of listTemplate.htmll
 
The first step is to include the JavaScript include file as shown below. ><script src="/faqx/javascript/pagination.js"> </script>
This function generates the href on the htmll page.
Next is the calling function, this javascript function should be included within the form tag.
The previously written code which displays the link at one shot, should be commented. 
Regenerate the site, by keeping the back up of changes made to the initially created site. 
These steps enable you to get the paging ribbon in all the auto/list Templates.
Changes to be made in metaTemplate for Custom list templates
The steps are same as above other than a small change in the generatehref function. Here in the path replace <…/auto/list/…> with <…/custom/…>
Changes to be made in Template
Initially the pagination.js file have to be included into the template. Replace the site name in the path.
JavaScript file can be included as shown below:
<script src ="/<sitename>/javascript/paginationjs.js "> </script>
Insert the generatehref() function within a script tag. Replace the htmll names in the replace tag with that particular htmll’s name for which you are making the changes.
Change the path accordingly for auto or custom in the above function.
Insert the calling function enclosed in a script tag, with in the form tags. Here the changes have to be made according to the name of the htmlls.
The previously written code which displays the link in one shot, should be commented. 
Some possible free marker code used in Pagination
$ {oC} : - This piece of code is used in metatemplate, it is used to generate a curly on the template. 
Notes
Older browsers (Netscape 1.X, Internet Explorer 2.X) do not support JavaScript and therefore do not recognize the <script> tag. These older browsers will ignore the <script> tag completely and simply display the JavaScript code in the browser, as if it were regular text on a page. To avoid this, surround your JavaScript code with comment tags, as shown below: <script language="JavaScript"> <!--
...code...
// --> </script>
This way, if the browser doesn't recognize the <script> tag, it will ignore everything between the <!-- (begin comment) and the --> (end comment) tags. Browsers that do recognize the <script> tag are aware of this limitation in older browsers and will ignore the <!-- and the --> tags, but will still interpret the JavaScript code. Note that the // in front of the --> is very important. Do not leave this out!
Notice that FreeMarker is invoked twice in zeroCode – once when the site is generated (to build the templates) and once when the page is generated. To ensure that the first run of FreeMarker at gen-time ignores the curly-brackets that need to be available at run-time, the special tag is declared and used as a replacement for the {character. So also for the character} – the tag is used.
For more information on FreeMarker tags, please click here.
Conclusion
The above metioned features have been integrated into zerocode through the meta template. New sites created will have these features as a built-in utility. You don’t need to do any changes to acquire this utility.