CN108363570A - A method of cascade menu is arranged in the XML based on Javascript - Google Patents
A method of cascade menu is arranged in the XML based on Javascript Download PDFInfo
- Publication number
- CN108363570A CN108363570A CN201711010064.XA CN201711010064A CN108363570A CN 108363570 A CN108363570 A CN 108363570A CN 201711010064 A CN201711010064 A CN 201711010064A CN 108363570 A CN108363570 A CN 108363570A
- Authority
- CN
- China
- Prior art keywords
- menu
- nodes
- level
- xml
- option
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Withdrawn
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/38—Creation or generation of source code for implementing user interfaces
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/31—Programming languages or programming paradigms
- G06F8/315—Object-oriented languages
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Human Computer Interaction (AREA)
- Computing Systems (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The present invention relates to Web development technique field, tool is related to a kind of method of the XML setting cascade menus based on Javascript.Method of the present invention is parsed to xml object datas using Javascrip, and the first order menu of web front end is obtained, and searches corresponding Level-2 menu node;Then option nodes are created to be added in the select nodes of the second level.The method of the present invention is easy to operate, solves the problems, such as the cascade data linkage display of web front end;Suitable for the browser of different editions, it is particularly suitable for the fields Web of JavaScript exploitations.
Description
Technical field
The present invention relates to Web development technique field, tool is related to a kind of XML setting cascade menus based on Javascript
Method.
Background technology
Currently, various Web pages or software often through a fixed-size menu interface in user interface to
Relevant information is presented in user.When the content-length that information is presented exceeds the size of menu interface, in order to show complete letter
Content is ceased, existing various Web pages or the mode of software generally use addition scroll bar or opening cascading menu are solved
Certainly.So-called cascade option menu is the menu selection pattern shown using multiple levels of content in user interface.
Invention content
Present invention solves the technical problem that being to provide a kind of side of the XML setting cascade menus based on Javascript
Method., solve the problems, such as the cascade data linkage display of web front end.
The present invention solve above-mentioned technical problem technical solution be:
The method is parsed to xml object datas using Javascrip, and the first order dish of web front end is obtained
It is single, and search corresponding Level-2 menu node;Then option nodes are created to be added in the select nodes of the second level.
The method specifically includes following steps:
Step 1:Xml object datas are parsed using Javascrip;
Step 2:The first order menu for obtaining web front end is clicked according to user using Javascrip;
Step 3:It goes to search in XML document according to front end first order menu parameter and obtains corresponding Level-2 menu node;
Step 4:The Level-2 menu node obtained using the first step creates option nodes in Web page;
Step 5:The option nodes created are added in the select nodes of the second level, in Web page exhibition
Show Level-2 menu nodal value.
In the step 1, parsing XML file is loaded by XMLDOM.
In the step 2, the of web front end is obtained according to document.getElementById using Javascrip
Further menu nodal value.
In the step 3, gone in XML document according to front end first order menu nodes value according to using
The method of xmlDocument.selectSingleNode and getElementsByTagName (xPath) visits node
It asks, is directly searched by xPath and obtain corresponding Level-2 menu node.
In the step 4, using the first step obtain Level-2 menu node parameter according to
Document.createElement (" option ") creates option nodes in Web page.
In the step 5, the option nodes created are added to according to appendChild the select of the second level
In node, to show Level-2 menu nodal value in Web page.
The method of the present invention and the interaction of JavaScript are more convenient, it is easier to dissection process, it is easy to operate;It solves
The cascade data linkage display problem of web front end.Suitable for the browser of different editions, it is particularly suitable for JavaSc and is suitable for not
With the browser of version,
Description of the drawings
The following further describes the present invention with reference to the drawings:
Fig. 1 is flow chart of the method for the present invention.
Specific implementation mode
As shown in Figure 1, a kind of method of the XML setting cascade menus based on Javascript of the present invention, it is specific comprising with
Under several steps:
Step 1:XML object data are parsed using Javascrip, need to load this XML file,
By loading parsing XML file by XMLDOM in Javascrip;
Step 2:The first order menu of web front end is obtained according to document.getElementById using Javascrip
Nodal value;
Step 3:It is gone in XML document according to front end first order menu nodes value according to using
The method of xmlDocument.selectSingleNode and getElementsByTagName (xPath) visits node
It asks, can directly be searched by xPath and obtain corresponding Level-2 menu node;
Step 4:Using the first step obtain Level-2 menu node parameter according to document.createElement ("
Option ") in Web page establishment option nodes;
Step 5:The option nodes created are added to according to appendChild in the select nodes of the second level,
To show Level-2 menu nodal value in Web page.
Claims (7)
1. a kind of method of the XML setting cascade menus based on Javascript, it is characterised in that:The method is to utilize
Javascrip parses xml object datas, obtains the first order menu of web front end, and searches corresponding Level-2 menu
Node;Then option nodes are created to be added in the select nodes of the second level.
2. according to the method described in claim 1, it is characterized in that:The method specifically includes following steps:
Step 1:Xml object datas are parsed using Javascrip;
Step 2:The first order menu for obtaining web front end is clicked according to user using Javascrip;
Step 3:It goes to search in XML document according to front end first order menu parameter and obtains corresponding Level-2 menu node;
Step 4:The Level-2 menu node obtained using the first step creates option nodes in Web page;
Step 5:The option nodes created are added in the select nodes of the second level, in Web page displaying the
Second-level menu nodal value.
3. according to the method described in claim 2, it is characterized in that:In the step 1, parsing XML is loaded by XMLDOM
File.
4. according to the method described in claim 2, it is characterized in that:In the step 2, using Javascrip according to
Document.getElementById obtains the first order menu nodes value of web front end.
5. according to the method described in claim 2, it is characterized in that:In the step 3, according to front end first order menu nodes
Value is gone in XML document according to using xmlDocument.selectSingleNode and getElementsByTagName
(xPath) method accesses to node, is directly searched by xPath and obtains corresponding Level-2 menu node.
6. according to the method described in claim 2, it is characterized in that:In the step 4, the second level of first step acquisition is utilized
Menu nodes parameter creates option nodes according to document.createElement (" option ") in Web page.
7. a method according to claim 2, it is characterised in that:In the step 5, the option nodes created
It is added in the select nodes of the second level according to appendChild, to show Level-2 menu nodal value in Web page.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711010064.XA CN108363570A (en) | 2017-10-25 | 2017-10-25 | A method of cascade menu is arranged in the XML based on Javascript |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201711010064.XA CN108363570A (en) | 2017-10-25 | 2017-10-25 | A method of cascade menu is arranged in the XML based on Javascript |
Publications (1)
Publication Number | Publication Date |
---|---|
CN108363570A true CN108363570A (en) | 2018-08-03 |
Family
ID=63010049
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201711010064.XA Withdrawn CN108363570A (en) | 2017-10-25 | 2017-10-25 | A method of cascade menu is arranged in the XML based on Javascript |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108363570A (en) |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101452380A (en) * | 2007-12-05 | 2009-06-10 | 康佳集团股份有限公司 | Method and system for implementing multi-stage linkage pulldown menu based on MVC model |
WO2014193380A1 (en) * | 2013-05-30 | 2014-12-04 | Empire Technology Development Llc | Multi-display system |
CN106648335A (en) * | 2016-12-27 | 2017-05-10 | 天脉聚源(北京)科技有限公司 | Secondary-linkage menu building method and apparatus |
-
2017
- 2017-10-25 CN CN201711010064.XA patent/CN108363570A/en not_active Withdrawn
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101452380A (en) * | 2007-12-05 | 2009-06-10 | 康佳集团股份有限公司 | Method and system for implementing multi-stage linkage pulldown menu based on MVC model |
WO2014193380A1 (en) * | 2013-05-30 | 2014-12-04 | Empire Technology Development Llc | Multi-display system |
CN106648335A (en) * | 2016-12-27 | 2017-05-10 | 天脉聚源(北京)科技有限公司 | Secondary-linkage menu building method and apparatus |
Non-Patent Citations (2)
Title |
---|
LIUHENGHUI5201: "使用javascript中读取Xml文件做成的一个二级联动菜单", 《HTTPS://BLOG.CSDN.NET/LIUHENGHUI5201/ARTICLE/DETAILS/21303551》 * |
超越梦想: "JS读取XML设置级联菜单", 《HTTPS://BLOG.CSDN.NET/ZSF8701/ARTICLE/DETAILS/7839611》 * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8122104B2 (en) | Method and system for providing XML-based asynchronous and interactive feeds for web applications | |
US20070240032A1 (en) | Method and system for vertical acquisition of data from HTML tables | |
US20090019386A1 (en) | Extraction and reapplication of design information to existing websites | |
US8584009B2 (en) | Automatically propagating changes in document access rights for subordinate document components to superordinate document components | |
US20070027932A1 (en) | System and method of creating a single source rss document from multiple content sources | |
US9223770B1 (en) | Method and apparatus of creating electronic forms to include internet list data | |
US20100235725A1 (en) | Selective display of elements of a schema set | |
US20140250369A1 (en) | Interactive special paste | |
US8826112B2 (en) | Navigating table data with mouse actions | |
US20130019189A1 (en) | Augmented editing of an online document | |
JP2004265402A (en) | Method and system for extending pasting function of computer software application | |
US20080172219A1 (en) | Foreign language translator in a document editor | |
JP2009510650A (en) | Multi-form design with harmonized composition for dynamically aggregated documents | |
US8812551B2 (en) | Client-side manipulation of tables | |
US20120072826A1 (en) | Methods and systems of outputting content of interest | |
US8302075B1 (en) | Methods and systems for selective code collapse | |
CN105447198A (en) | Convenient page script importing method and device | |
JP5067459B2 (en) | Image formation control program and image processing apparatus | |
AU2013204600A1 (en) | Method and apparatus for correcting document formatting based on source document | |
US20090031211A1 (en) | Programming extension for authoring style rules | |
US20100023852A1 (en) | Declarative forms and views | |
US20080115051A1 (en) | Providing assistance with the creation of an XPath expression | |
US20050223355A1 (en) | Aiding a user in using a software application | |
CN108363570A (en) | A method of cascade menu is arranged in the XML based on Javascript | |
Hori et al. | Generating transformational annotation for web document adaptation: tool support and empirical evaluation |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
WW01 | Invention patent application withdrawn after publication |
Application publication date: 20180803 |
|
WW01 | Invention patent application withdrawn after publication |