4. Index.htm.files / JS / Common.js The following is listed under the common.js file and the display function related to the display function, and other functions will be described in detail.
// File Name: Common.js // Declaration of common JavaScript functions / /: 刘海龙 / // xiaoleilong@mail.biti.edu.cn // August 1, 2003
// Initialization The content that needs to be displayed function init () {var coll = document.all.tags ("div"); var i; for (i = 0; i <3; i ) COLL [i] .style.display = "none"; coll [0] .innerhtml = do_trans ("index.htm.files / data / record.xml", "index.htm.files / styles / normal.xsl"); // Display view coll [1] .innerhtml = get_EDit_view (); coll [2] .innerhtml = get_set_view ();} / ** function do_trans ((strXmlpath, strxslpath) * Parameters: Specify path of XML files and XSL files * Function: Using XSL to XML Conversion * Return: Converted String * / Function Do_Trans (Strxmlpath, Strxslpath) {// Load XML VAR XML = New ActiveXObject ("Microsoft.xmLDom") Xml.async = false Xml.Load (strXmlpath) // load the XSL VAR XSL = New ActiveXObject ("Microsoft.xmldom") xsl.async = false xsl.load (strxslpath) // Transform Return XML.TransFormNode (XSL);
/ ** Function DISP_SPEC_SECT (Section) * Parameters: Specify the page that will be switched to, where: DISP - Display the page of the resume; Edit - Edit the resume page; set - the page of the basic settings. * Function: Switch to the specified page according to the value of the section parameter. * Return: No return value * / function data {var coll = document.all.tags ("div"); if (COLL! = Null) {for (i = 0; i