<div id="msg"> </div> <mce:script type="text/javascript"><!-- var xmlDoc=null; if (window.ActiveXObject) {// code for IE xmlDoc=new ActiveXObject("Microsoft.XMLDOM"); } else if (document.implementation.createDocument) {// code for Mozilla, Firefox, Opera, etc. xmlDoc=document.implementation.createDocument("","",null); } else { alert('Your browser cannot handle this script'); } if (xmlDoc!=null) { xmlDoc.async=false; xmlDoc.load("/example/xmle/cd_catalog.xml"); var x=xmlDoc.getElementsByTagName("CD"); document.write("<table border='1'>"); document.write("<thead>"); document.write("<tr><th>Artist</th><th>Title</th></tr>"); document.write("</thead>"); document.write("<tfoot>"); document.write("<tr><th colspan='2'>This is my CD collection</th></tr>"); document.write("</tfoot>"); for (var i=0;i<x.length;i++) { document.write("<tr>"); document.write("<td>"); document.write(x[i].getElementsByTagName("ARTIST")[0].childNodes[0].nodeValue); document.write("</td>"); document.write("<td>"); document.write(x[i].getElementsByTagName("TITLE")[0].childNodes[0].nodeValue); document.write("</td>"); document.write("</tr>"); } document.write("</table>"); } // --></mce:script> <asp:Button ID="Button1" runat="server" Text="Button" /> <mce:script language="javascript" type="text/javascript"><!-- var Msg=document.getElementById("msg"); Msg.innerHTML="<div id=/"alert/"><p><label>用户名</label>" +"<input type=/"text/" name=/"username/" id=/"logname/" class=/"myinp/" οnmοuseοver=/"this.style.border='1px solid #f60'/" οnfοcus=/"this.style.border='1px solid #f60'/" οnblur=/"this.style.border='1px solid #ccc'/" /></p><p><label> 密 码</label><input type=/"password/" name=/"pwd/" id=/"logpassword/" class=/"myinp/" οnmοuseοver=/"this.style.border='1px solid #f60'/" οnfοcus=/"this.style.border='1px solid #f60'/" οnblur=/"this.style.border='1px solid #ccc'/" /></p><p><input id=/"Submit_log/" type=/"submit/" value=/"登录/" />" +"<input type=/"reset/" value=/"重置/" class=/"sub/" /></p></div>"; // --></mce:script> 结果 用户名 密 码 ArtistTitleThis is my CD collection