Client cgi--combines JavaScript and DHTML to realize BackOffice of BBs (I.).

Source: Internet
Author: User
Tags array arrays html page dreamweaver javascript array
cgi|dhtml| Client Client cgi--combine JavaScript, DHTML to implement BackOffice of BBS (only once with server).
Recently saw a lot of friends asked about the form element operation problem, the following I wrote a BBS BackOffice part of the post to everyone. This program realizes the BBS in the column and its subordinate forum to add, delete, rename, sort, move, modify attributes and so on, but only with the server interaction once, which used the table cells known as text, button, Submit,select, textarea and so on, If you can fully understand the code, then it is not possible to say that you are proficient in JavaScript and DHTML (I dare not), at least you will.
Because it is a draft, so there is no program optimization and interface processing, in fact, if you combine CSS you can do it like a Windows program rather than HTML page. The other one, because I tested it with IE5, so some of the writing is not very normative, such as the reference to the form name before the document, the function does not return the value, and so on, these are not allowed in the Nescape, if you want to use in the Nescape, please own the grammar specification.
Because the source code is very long (more than 30,000 bytes), I will be divided into several parts, you put the code in several parts together to save as an HTML file can run directly. First you need to take the records out of the database and put them in the foreground JavaScript array, because the focus is on the foreground, so here's the ASP I don't list, just the HTML generated by the column, its purpose is to generate an array and the initial page. This part of the code involves a technique to generate JavaScript two-dimensional arrays, so take a closer look at this, which is the key to the entire program. The following program generates two arrays, one is Acategory, represents the BBS large column, a total of four, and the other is Aforum, representing the forum associated with the column. The operation of the entire program is actually done around two arrays, and the two arrays are associated with two select:selcategory and selforum of the form Frmmanager.


<script language=javascript>

The constructor of an array of plates
function Makecategory (CategoryID, CategoryName, Ordernum)
{
This. CategoryID = CategoryID;
This. CategoryName = CategoryName;
This. Ordernum = Ordernum;
return this;
}

Constructors for forum arrays
function Makeforum (CategoryID, CategoryName, Ordernum, Rootcategoryid, Description, MasterID)
{
This. CategoryID = CategoryID;
This. CategoryName = CategoryName;
This. Ordernum = Ordernum;
This. Rootcategoryid = Rootcategoryid;
This. Description = Description;
This. MasterID = MasterID;
return this;
}

Set up an array of plates and assign values
var acategory = new Array ();
Acategory[0] = new Makecategory (1, ' Technical exchange ', 1);
ACATEGORY[1] = new Makecategory (2, ' Project Management ', 2);
ACATEGORY[2] = new Makecategory (3, ' Internal Bulletin ', 3);
ACATEGORY[3] = new Makecategory (4, ' brighter ', 4);

Set up forum arrays and assign values
var aforum = new Array ();
Aforum[0] = new Makeforum (5, ' asp&database ', 1, 1, ' Asp, ACCESS,PB, Sql.oralce,etc. ', 1);
AFORUM[1] = new Makeforum (6, ' Design World ', 2, 1, ' Photoshop,dreamweaver,flash, 3dmax,etc. ', 2);
AFORUM[2] = new Makeforum (7, ' Design World ', 3, 1, ' Photoshop,dreamweaver,flash, 3dmax,etc. ', 2);
AFORUM[3] = new Makeforum (8, ' Program Language ', 4, 1, ' Java, Html/dhtml/xml, C + +, php/jsp, vbscript/javascript, etc. ' 1);
AFORUM[4] = new Makeforum (9, ' System Administration ', 5, 1, ' windows9x/nt/2000, Unix, Linux, etc. ', 2);
AFORUM[5] = new Makeforum (Ten, ' Network security ', 6, 1, ' TCP/IP, Socket, hacker, FireWall, Proxy, etc. ', 1);
AFORUM[6] = new Makeforum (one, ' New Idea ', 7, 1, ' Welcome all Creative, innovative and anything different. ', 1);
AFORUM[7] = new Makeforum (4biz e-commerce search Engine Portal project, 1, 2, ' E-Commerce search Engine portal. ', 2);
AFORUM[8] = new Makeforum (, ' Poker Town ', 2, 2, ' our "," Game. ", 1);
AFORUM[9] = new Makeforum, ' Vertigine ', 3, 2, ' powerful Vertical Search Engine. ', 2;
AFORUM[10] = new Makeforum (, ' Easycase ', 4, 2, ' easycase-new modeling tool. ', 1);
AFORUM[11] = new Makeforum (16, ' day-to-day management ', 1, 3, ' Daily Grind ', 2);
AFORUM[12] = new Makeforum (17, ' interim notice ', 2, 3, ' temporary Notice. ', 1);
AFORUM[13] = new Makeforum (18, ' Conference Schedule ', 3, 3, ' meeting Schedule. ', 2);
AFORUM[14] = new Makeforum (19, ' inductive ', 4, 4, ' Just say it. ', 1);
AFORUM[15] = new Makeforum (20, ' Timesong ', 5, 4, ' All of that Gone with wind. ', 1);
AFORUM[16] = new Makeforum (21, ' romance ', 6, 4, ' let ' s talk About love. ', 2);
AFORUM[17] = new Makeforum (22, ' joke stand ', 7, 4, ' Just joke, whatever it is. ', 1);

</script>

<



Related Article

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.