Javascript|xml
1. When using XSL to display XML content, be aware that when using XSL documents to define styles:
In an HTML document, there are
<base href= "http://127.0.0.1:7001/MagazineResearchStageWeb/" >
means that external documents such as the referenced XSL must be in the href directory. Otherwise, you cannot refer to external documents.
2. After the XML string is processed through a new string, the Var xmlstr=new string (xmlinfo.innerhtml);
All the node names are capitalized (properties are not affected). Therefore, when processing or displaying, notice the change in the node name.
3.var XSLD = new ActiveXObject ("Msxml2.domdocument");
Xsld.load ("test.xsl"), alert (Xsld.xml), can also display the contents of the XSL.
4. <xsl:element>,<xsl:attribute> can be used to support the diversity of display dynamic operations. Cases:
<TD valign= "Top" ><xsl:element name= ' a ' ><xsl:attribute name= ' href ' >./showmagazineinfo.jsp? magazineid=<xsl:value-of select= "Magazineid"/></xsl:attribute><xsl:value-of select= " Magazinefilename "/></xsl:element></td> <!--enables access to the information corresponding to the generated URL address >
5. When using <body > in a Web page, when the fun () function accesses the value of the ID or name on the page, especially if the string value is longer, the JavaScript error occurs and the correct operation is not displayed. The reason for the error: The data being accessed is incomplete.
This is related to the caching of a Web page, but not to it, but to the load () and network speed.
When you must be in the page load complete, or a section of data completed transmission after the implementation of the solution:
Put <script language= "JavaScript" >
Transforminfo ();
</script>
After you have placed the page data you want to manipulate, it can be executed in the process of displaying the page.
6. In the use of JavaScript, usually ASCII encoding, otherwise, IE browser will not recognize the Chinese (utf-8 encoding is not good), with the Web page encoding. Otherwise javascript is wrong!
7.javascript DOM itself cannot handle invalid characters such as <>, which automatically transcoding only if the value entered by the user is accepted through JavaScript. cannot be in the page, and cannot access all the data to a node node!