用户控件问题与JS函数有关
<%@ Control Language= "C# " AutoEventWireup= "true " CodeFile= "Style1.ascx.cs " Inherits= "Style1 " %>
<script language= "javascript ">
//读取xml
function ReadXml()
{
var xmlDoc = new ActiveXObject( "MSXML2.DOMDocument.3.0 ");
xmlDoc.async = false;
xmlDoc.load( "style.xml ");
if(xmlDoc.parseError.errorCode != 0)
{
delete(xmlDoc);
window.alert( "数据加载错误,请检查数据连接! ");
window.close();
}
var ItemN = xmlDoc.getElementByTagName( "DaoHang ");
var j = ItemN.length; //获取DaoHang节点个数
var name = new Array();
var url = new Array();
var str = " <ul> ";
for(var i=0; i <j; i++)
{
if(xmlDoc.selectSingleNode( "style/DaoHang/@Name ").value == "style1 ")
{
name[i] = ItemN[i].selectSingleNode( "name ").text;
url[i] = ItemN[i].selectSingleNode( "url ").text;
str += " <li> <a href= ' "+url[i]+ " '> "+name[i]+ " </a> </li> ";
str += " <li class= 'menuDiv '> </li