悬赏园豆:50
[已关闭问题]
<!--l version="1.0" encoding="utf-8"-->
<div class="cnblogs_code" onclick="cnblogs_code_show('08c046be-17c5-4fa3-9c65-693e81e93dcf')">xml 文件代码:</div>
<div class="cnblogs_code" onclick="cnblogs_code_show('08c046be-17c5-4fa3-9c65-693e81e93dcf')"><img id="code_img_closed_08c046be-17c5-4fa3-9c65-693e81e93dcf" class="code_img_closed" style="display: none;" src="http://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" alt="" /><img id="code_img_opened_08c046be-17c5-4fa3-9c65-693e81e93dcf" class="code_img_opened" onclick="cnblogs_code_hide('08c046be-17c5-4fa3-9c65-693e81e93dcf',event)" src="http://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" alt="" /><span class="cnblogs_code_collapse">代码</span>
<div id="cnblogs_code_open_08c046be-17c5-4fa3-9c65-693e81e93dcf">
<pre><div><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000ff;"><?</span><span style="color: #ff00ff;">xml version="1.0" encoding="utf-8" </span><span style="color: #0000ff;">?></span><span style="color: #000000;"><br /></span><span style="color: #0000ff;"><</span><span style="color: #800000;">class</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Erect</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Item</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Id</span><span style="color: #0000ff;">></span><span style="color: #000000;">1</span><span style="color: #0000ff;"></</span><span style="color: #800000;">Id</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Tag</span><span style="color: #0000ff;">></span><span style="color: #000000;">厨房用品</span><span style="color: #0000ff;"></</span><span style="color: #800000;">Tag</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">More</span><span style="color: #0000ff;">></span><span style="color: #000000;">true</span><span style="color: #0000ff;"></</span><span style="color: #800000;">More</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"></</span><span style="color: #800000;">Item</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Item</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Id</span><span style="color: #0000ff;">></span><span style="color: #000000;">2</span><span style="color: #0000ff;"></</span><span style="color: #800000;">Id</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Tag</span><span style="color: #0000ff;">></span><span style="color: #000000;">卫浴用品</span><span style="color: #0000ff;"></</span><span style="color: #800000;">Tag</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">More</span><span style="color: #0000ff;">></span><span style="color: #000000;">false</span><span style="color: #0000ff;"></</span><span style="color: #800000;">More</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"></</span><span style="color: #800000;">Item</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Item</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Id</span><span style="color: #0000ff;">></span><span style="color: #000000;">3</span><span style="color: #0000ff;"></</span><span style="color: #800000;">Id</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Tag</span><span style="color: #0000ff;">></span><span style="color: #000000;">卧室用品</span><span style="color: #0000ff;"></</span><span style="color: #800000;">Tag</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">More</span><span style="color: #0000ff;">></span><span style="color: #000000;">true</span><span style="color: #0000ff;"></</span><span style="color: #800000;">More</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"></</span><span style="color: #800000;">Item</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Item</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Id</span><span style="color: #0000ff;">></span><span style="color: #000000;">4</span><span style="color: #0000ff;"></</span><span style="color: #800000;">Id</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Tag</span><span style="color: #0000ff;">></span><span style="color: #000000;">客厅用品</span><span style="color: #0000ff;"></</span><span style="color: #800000;">Tag</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">More</span><span style="color: #0000ff;">></span><span style="color: #000000;">false</span><span style="color: #0000ff;"></</span><span style="color: #800000;">More</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"></</span><span style="color: #800000;">Item</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"></</span><span style="color: #800000;">Erect</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> <br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">House</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Item</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Id</span><span style="color: #0000ff;">></span><span style="color: #000000;">5</span><span style="color: #0000ff;"></</span><span style="color: #800000;">Id</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Tag</span><span style="color: #0000ff;">></span><span style="color: #000000;">电视机</span><span style="color: #0000ff;"></</span><span style="color: #800000;">Tag</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">More</span><span style="color: #0000ff;">></span><span style="color: #000000;">true</span><span style="color: #0000ff;"></</span><span style="color: #800000;">More</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"></</span><span style="color: #800000;">Item</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Item</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Id</span><span style="color: #0000ff;">></span><span style="color: #000000;">6</span><span style="color: #0000ff;"></</span><span style="color: #800000;">Id</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Tag</span><span style="color: #0000ff;">></span><span style="color: #000000;">洗衣机</span><span style="color: #0000ff;"></</span><span style="color: #800000;">Tag</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">More</span><span style="color: #0000ff;">></span><span style="color: #000000;">true</span><span style="color: #0000ff;"></</span><span style="color: #800000;">More</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"></</span><span style="color: #800000;">Item</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Item</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Id</span><span style="color: #0000ff;">></span><span style="color: #000000;">7</span><span style="color: #0000ff;"></</span><span style="color: #800000;">Id</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Tag</span><span style="color: #0000ff;">></span><span style="color: #000000;">电冰箱</span><span style="color: #0000ff;"></</span><span style="color: #800000;">Tag</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">More</span><span style="color: #0000ff;">></span><span style="color: #000000;">true</span><span style="color: #0000ff;"></</span><span style="color: #800000;">More</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"></</span><span style="color: #800000;">Item</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Item</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Id</span><span style="color: #0000ff;">></span><span style="color: #000000;">8</span><span style="color: #0000ff;"></</span><span style="color: #800000;">Id</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Tag</span><span style="color: #0000ff;">></span><span style="color: #000000;">电脑</span><span style="color: #0000ff;"></</span><span style="color: #800000;">Tag</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">More</span><span style="color: #0000ff;">></span><span style="color: #000000;">true</span><span style="color: #0000ff;"></</span><span style="color: #800000;">More</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"></</span><span style="color: #800000;">Item</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;"></</span><span style="color: #800000;">House</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> <br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">MaMiBaby</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> <br /> </span><span style="color: #0000ff;"></</span><span style="color: #800000;">MaMiBaby</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> <br /> </span><span style="color: #0000ff;"><</span><span style="color: #800000;">Marry</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /> <br /> </span><span style="color: #0000ff;"></</span><span style="color: #800000;">Marry</span><span style="color: #0000ff;">></span><span style="color: #000000;"><br /></span><span style="color: #0000ff;"></</span><span style="color: #800000;">class</span><span style="color: #0000ff;">></span></div></pre>
</div>
</div>
<p>Js代码</p>
<div class="cnblogs_code" onclick="cnblogs_code_show('fa17f535-75ea-4da4-84fd-bd728698e0a5')"><img id="code_img_closed_fa17f535-75ea-4da4-84fd-bd728698e0a5" class="code_img_closed" style="display: none;" src="http://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif" alt="" /><img id="code_img_opened_fa17f535-75ea-4da4-84fd-bd728698e0a5" class="code_img_opened" onclick="cnblogs_code_hide('fa17f535-75ea-4da4-84fd-bd728698e0a5',event)" src="http://images.cnblogs.com/OutliningIndicators/ExpandedBlockStart.gif" alt="" /><span class="cnblogs_code_collapse">代码</span>
<div id="cnblogs_code_open_fa17f535-75ea-4da4-84fd-bd728698e0a5">
<pre><div><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000ff;">var</span><span style="color: #000000;"> Sys </span><span style="color: #000000;">=</span><span style="color: #000000;"> {};<br /></span><span style="color: #0000ff;">var</span><span style="color: #000000;"> ua </span><span style="color: #000000;">=</span><span style="color: #000000;"> navigator.userAgent.toLowerCase();<br /></span><span style="color: #0000ff;">var</span><span style="color: #000000;"> s;<br />(s </span><span style="color: #000000;">=</span><span style="color: #000000;"> ua.match(</span><span style="color: #000000;">/</span><span style="color: #000000;">msie ([\d.]+)</span><span style="color: #000000;">/</span><span style="color: #000000;">)) </span><span style="color: #000000;">?</span><span style="color: #000000;"> Sys.ie </span><span style="color: #000000;">=</span><span style="color: #000000;"> s[</span><span style="color: #000000;">1</span><span style="color: #000000;">] :<br />(s </span><span style="color: #000000;">=</span><span style="color: #000000;"> ua.match(</span><span style="color: #000000;">/</span><span style="color: #000000;">firefox\</span><span style="color: #000000;">/</span><span style="color: #000000;">([\d.]</span><span style="color: #000000;">+</span><span style="color: #000000;">)</span><span style="color: #000000;">/</span><span style="color: #000000;">)) ? Sys.firefox = s[1] :</span><span style="color: #000000;"><br /></span><span style="color: #000000;">(s </span><span style="color: #000000;">=</span><span style="color: #000000;"> ua.match(</span><span style="color: #000000;">/</span><span style="color: #000000;">chrome\</span><span style="color: #000000;">/</span><span style="color: #000000;">([\d.]</span><span style="color: #000000;">+</span><span style="color: #000000;">)</span><span style="color: #000000;">/</span><span style="color: #000000;">)) ? Sys.chrome = s[1] :</span><span style="color: #000000;"><br /></span><span style="color: #000000;">(s </span><span style="color: #000000;">=</span><span style="color: #000000;"> ua.match(</span><span style="color: #000000;">/</span><span style="color: #000000;">opera.([\d.]+)</span><span style="color: #000000;">/</span><span style="color: #000000;">)) </span><span style="color: #000000;">?</span><span style="color: #000000;"> Sys.opera </span><span style="color: #000000;">=</span><span style="color: #000000;"> s[</span><span style="color: #000000;">1</span><span style="color: #000000;">] :<br />(s </span><span style="color: #000000;">=</span><span style="color: #000000;"> ua.match(</span><span style="color: #000000;">/</span><span style="color: #000000;">version\</span><span style="color: #000000;">/</span><span style="color: #000000;">([\d.]</span><span style="color: #000000;">+</span><span style="color: #000000;">).</span><span style="color: #000000;">*</span><span style="color: #000000;">safari</span><span style="color: #000000;">/</span><span style="color: #000000;">)) ? Sys.safari = s[1] : 0;</span><span style="color: #000000;"><br /></span><span style="color: #000000;"><br /><br /></span><span style="color: #008000;">//</span><span style="color: #008000;">if (Sys.ie) alert('IE: ' + Sys.ie);</span><span style="color: #008000;"><br />//</span><span style="color: #008000;">if (Sys.firefox) alert('Firefox: ' + Sys.firefox);</span><span style="color: #008000;"><br />//</span><span style="color: #008000;">if (Sys.chrome) alert('Chrome: ' + Sys.chrome);</span><span style="color: #008000;"><br />//</span><span style="color: #008000;">if (Sys.opera) alert('Opera: ' + Sys.opera);</span><span style="color: #008000;"><br />//</span><span style="color: #008000;">if (Sys.safari) alert('Safari: ' + Sys.safari);</span><span style="color: #008000;"><br /></span><span style="color: #000000;"><br /><br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> xmlHttp;<br /><br /> </span><span style="color: #0000ff;">function</span><span style="color: #000000;"> createXMLHttpRequest()<br /> {<br /> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(window.ActiveXObject)<br /> {<br /> xmlHttp </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">new</span><span style="color: #000000;"> ActiveXObject(</span><span style="color: #000000;">"</span><span style="color: #000000;">Microsoft.XMLHTTP</span><span style="color: #000000;">"</span><span style="color: #000000;">);<br /> }<br /> </span><span style="color: #0000ff;">else</span><span style="color: #000000;"> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(window.XMLHttpRequest)<br /> {<br /> xmlHttp </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">new</span><span style="color: #000000;"> XMLHttpRequest();<br /> }<br /> <br /> <br /> <br /> } <br /> <br /> <br /><br /> <br /> <br /> <br /> <br /></span><span style="color: #008000;">//</span><span style="color: #008000;">//////////////////////////////////////////////////////////// </span><span style="color: #008000;"><br /></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> clsId </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">""</span><span style="color: #000000;">; <br /> <br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> objFrame </span><span style="color: #000000;">=</span><span style="color: #000000;"> document.getElementById(</span><span style="color: #000000;">"</span><span style="color: #000000;">Frame1</span><span style="color: #000000;">"</span><span style="color: #000000;">);<br /> <br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> objChild </span><span style="color: #000000;">=</span><span style="color: #000000;"> objFrame.children;<br /> <br /><br /> </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">var</span><span style="color: #000000;"> i</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;i</span><span style="color: #000000;"><</span><span style="color: #000000;">objChild.length;i</span><span style="color: #000000;">++</span><span style="color: #000000;">){<br /> <br /> objChild[i].onmouseover </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">function</span><span style="color: #000000;">(){<br /> <br /> </span><span style="color: #0000ff;">this</span><span style="color: #000000;">.className</span><span style="color: #000000;">=</span><span style="color: #000000;">"</span><span style="color: #000000;">FrameItem ItemDiv</span><span style="color: #000000;">"</span><span style="color: #000000;">;<br /> }<br /> <br /> objChild[i].onmouseout </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">function</span><span style="color: #000000;">(){<br /> <br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> css </span><span style="color: #000000;">=</span><span style="color: #000000;">1</span><span style="color: #000000;">;<br /> <br /> </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">var</span><span style="color: #000000;"> j</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;j</span><span style="color: #000000;"><</span><span style="color: #000000;">objChild.length;j</span><span style="color: #000000;">++</span><span style="color: #000000;">)<br /> { <br /> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(</span><span style="color: #0000ff;">this</span><span style="color: #000000;">.id </span><span style="color: #000000;">==</span><span style="color: #000000;"> objChild[j].id)<br /> css </span><span style="color: #000000;">=</span><span style="color: #000000;"> j</span><span style="color: #000000;">+</span><span style="color: #000000;">1</span><span style="color: #000000;">;<br /> }<br /> <br /> </span><span style="color: #0000ff;">this</span><span style="color: #000000;">.className </span><span style="color: #000000;">=</span><span style="color: #000000;">"</span><span style="color: #000000;">cls cls</span><span style="color: #000000;">"</span><span style="color: #000000;"> </span><span style="color: #000000;">+</span><span style="color: #000000;"> css </span><span style="color: #000000;">+</span><span style="color: #000000;"> </span><span style="color: #000000;">"</span><span style="color: #000000;"> ItemDiv</span><span style="color: #000000;">"</span><span style="color: #000000;">;<br /> }<br /> <br /> objChild[i].onclick</span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">function</span><span style="color: #000000;">(){<br /> <br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> o </span><span style="color: #000000;">=</span><span style="color: #000000;"> document.getElementById(</span><span style="color: #000000;">"</span><span style="color: #000000;">SelectText</span><span style="color: #000000;">"</span><span style="color: #000000;">);<br /> <br /> clsId </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">this</span><span style="color: #000000;">.id;<br /> <br /> GetCls1();<br /> <br /> }<br /> }<br /> <br /></span><span style="color: #008000;">//</span><span style="color: #008000;">//////////////////////////////////////////////////////////////////////</span><span style="color: #008000;"><br /></span><span style="color: #000000;"><br /><br /> </span><span style="color: #0000ff;">function</span><span style="color: #000000;"> GetCls1()<br /> {<br /> createXMLHttpRequest();<br /> <br /> UrlParameter</span><span style="color: #000000;">=</span><span style="color: #000000;">"</span><span style="color: #000000;">ts=</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #0000ff;">new</span><span style="color: #000000;"> Date().getTime();<br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> url</span><span style="color: #000000;">=</span><span style="color: #000000;">""</span><span style="color: #000000;">;<br /> <br /> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(Sys.ie)<br /> {<br /> url </span><span style="color: #000000;">=</span><span style="color: #000000;">"</span><span style="color: #000000;">/Xml/cls1.xml?</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">UrlParameter;<br /> xmlHttp.open(</span><span style="color: #000000;">"</span><span style="color: #000000;">GET</span><span style="color: #000000;">"</span><span style="color: #000000;">,url,</span><span style="color: #0000ff;">true</span><span style="color: #000000;">);<br /> xmlHttp.onreadystatechange </span><span style="color: #000000;">=</span><span style="color: #000000;"> callback;<br /> }<br /> </span><span style="color: #0000ff;">else</span><span style="color: #000000;"><br /> {<br /> url </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #000000;">"</span><span style="color: #000000;">/Xml/cls1.txt?</span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">UrlParameter;<br /> xmlHttp.open(</span><span style="color: #000000;">"</span><span style="color: #000000;">GET</span><span style="color: #000000;">"</span><span style="color: #000000;">,url,</span><span style="color: #0000ff;">true</span><span style="color: #000000;">);<br /> xmlHttp.onreadystatechange </span><span style="color: #000000;">=</span><span style="color: #000000;"> callback2;<br /> }<br /><br /> xmlHttp.send(</span><span style="color: #0000ff;">null</span><span style="color: #000000;">);<br /> <br /> }<br /><br /> </span><span style="color: #0000ff;">function</span><span style="color: #000000;"> callback()<br /> {<br /> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(xmlHttp.readyState </span><span style="color: #000000;">==</span><span style="color: #000000;">4</span><span style="color: #000000;">)<br /> {<br /> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(xmlHttp.status </span><span style="color: #000000;">==</span><span style="color: #000000;">200</span><span style="color: #000000;">)<br /> {<br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> XmlData</span><span style="color: #000000;">=</span><span style="color: #000000;">""</span><span style="color: #000000;"> ;<br /> XmlData </span><span style="color: #000000;">=</span><span style="color: #000000;"> xmlHttp.responseXML;<br /> setData(XmlData);<br /> }<br /> </span><span style="color: #0000ff;">else</span><span style="color: #000000;"><br /> {<br /> document.getElementById(</span><span style="color: #000000;">"</span><span style="color: #000000;">Frame2</span><span style="color: #000000;">"</span><span style="color: #000000;">).innerHTML</span><span style="color: #000000;">=</span><span style="color: #000000;">"</span><span style="color: #000000;"><div class=\</span><span style="color: #000000;">"</span><span style="color: #000000;">Loading\</span><span style="color: #000000;">"</span><span style="color: #000000;">></div></span><span style="color: #000000;">"</span><span style="color: #000000;">;<br /> }<br /> }<br /> </span><span style="color: #0000ff;">else</span><span style="color: #000000;"><br /> {<br /> document.getElementById(</span><span style="color: #000000;">"</span><span style="color: #000000;">Frame2</span><span style="color: #000000;">"</span><span style="color: #000000;">).innerHTML</span><span style="color: #000000;">=</span><span style="color: #000000;">"</span><span style="color: #000000;"><div class=\</span><span style="color: #000000;">"</span><span style="color: #000000;">Loading\</span><span style="color: #000000;">"</span><span style="color: #000000;">></div></span><span style="color: #000000;">"</span><span style="color: #000000;">;<br /> }<br /> }<br /> <br /> </span><span style="color: #0000ff;">function</span><span style="color: #000000;"> callback2()<br /> {<br /> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(xmlHttp.readyState </span><span style="color: #000000;">==</span><span style="color: #000000;">4</span><span style="color: #000000;">)<br /> {<br /> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(xmlHttp.status </span><span style="color: #000000;">==</span><span style="color: #000000;">200</span><span style="color: #000000;">)<br /> {<br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> XmlData</span><span style="color: #000000;">=</span><span style="color: #000000;">""</span><span style="color: #000000;"> ;<br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> parser </span><span style="color: #000000;">=</span><span style="color: #000000;"> </span><span style="color: #0000ff;">new</span><span style="color: #000000;"> DOMParser; <br /> XmlData </span><span style="color: #000000;">=</span><span style="color: #000000;"> parser.parseFromString(xmlHttp.responseText, </span><span style="color: #000000;">"</span><span style="color: #000000;">text/xml</span><span style="color: #000000;">"</span><span style="color: #000000;">); <br /> setData2(XmlData);<br /> }<br /> </span><span style="color: #0000ff;">else</span><span style="color: #000000;"><br /> {<br /> document.getElementById(</span><span style="color: #000000;">"</span><span style="color: #000000;">Frame2</span><span style="color: #000000;">"</span><span style="color: #000000;">).innerHTML</span><span style="color: #000000;">=</span><span style="color: #000000;">"</span><span style="color: #000000;"><div class=\</span><span style="color: #000000;">"</span><span style="color: #000000;">Loading\</span><span style="color: #000000;">"</span><span style="color: #000000;">></div></span><span style="color: #000000;">"</span><span style="color: #000000;">;<br /> }<br /> }<br /> </span><span style="color: #0000ff;">else</span><span style="color: #000000;"><br /> {<br /> document.getElementById(</span><span style="color: #000000;">"</span><span style="color: #000000;">Frame2</span><span style="color: #000000;">"</span><span style="color: #000000;">).innerHTML</span><span style="color: #000000;">=</span><span style="color: #000000;">"</span><span style="color: #000000;"><div class=\</span><span style="color: #000000;">"</span><span style="color: #000000;">Loading\</span><span style="color: #000000;">"</span><span style="color: #000000;">></div></span><span style="color: #000000;">"</span><span style="color: #000000;">;<br /> }<br /> }<br /> <br /><br /> </span><span style="color: #0000ff;">function</span><span style="color: #000000;"> setData(XmlData)<br /> { <br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> clsHtml</span><span style="color: #000000;">=</span><span style="color: #000000;">""</span><span style="color: #000000;">;<br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> clsNode </span><span style="color: #000000;">=</span><span style="color: #000000;"> XmlData.getElementsByTagName(clsId)[</span><span style="color: #000000;">0</span><span style="color: #000000;">];<br /> <br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> clsChildNode </span><span style="color: #000000;">=</span><span style="color: #000000;"> clsNode.childNodes;<br /><br /> </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">var</span><span style="color: #000000;"> j</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;j</span><span style="color: #000000;"><</span><span style="color: #000000;">clsChildNode.length;j</span><span style="color: #000000;">++</span><span style="color: #000000;">)<br /> {<br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> ItemNode </span><span style="color: #000000;">=</span><span style="color: #000000;"> clsChildNode[j];<br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> Id </span><span style="color: #000000;">=</span><span style="color: #000000;"> ItemNode.getElementsByTagName(</span><span style="color: #000000;">"</span><span style="color: #000000;">Id</span><span style="color: #000000;">"</span><span style="color: #000000;">)[</span><span style="color: #000000;">0</span><span style="color: #000000;">].firstChild.nodeValue;<br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> Tag </span><span style="color: #000000;">=</span><span style="color: #000000;"> ItemNode.getElementsByTagName(</span><span style="color: #000000;">"</span><span style="color: #000000;">Tag</span><span style="color: #000000;">"</span><span style="color: #000000;">)[</span><span style="color: #000000;">0</span><span style="color: #000000;">].firstChild.nodeValue;<br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> More </span><span style="color: #000000;">=</span><span style="color: #000000;"> ItemNode.getElementsByTagName(</span><span style="color: #000000;">"</span><span style="color: #000000;">More</span><span style="color: #000000;">"</span><span style="color: #000000;">)[</span><span style="color: #000000;">0</span><span style="color: #000000;">].firstChild.nodeValue; <br /> <br /> clsHtml</span><span style="color: #000000;">+=</span><span style="color: #000000;">"</span><span style="color: #000000;"><a href=\</span><span style="color: #000000;">"</span><span style="color: #000000;">ClsSelect.aspx</span><span style="color: #000000;">?</span><span style="color: #000000;">Ids</span><span style="color: #000000;">=</span><span style="color: #000000;">"</span><span style="color: #000000;">+Id+</span><span style="color: #000000;">"</span><span style="color: #000000;">\</span><span style="color: #000000;">"</span><span style="color: #000000;">><div</span><span style="color: #000000;">"</span><span style="color: #000000;">;<br /> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(More</span><span style="color: #000000;">==</span><span style="color: #000000;">"</span><span style="color: #000000;">true</span><span style="color: #000000;">"</span><span style="color: #000000;">)<br /> clsHtml</span><span style="color: #000000;">+=</span><span style="color: #000000;">"</span><span style="color: #000000;"> class=\</span><span style="color: #000000;">"</span><span style="color: #000000;">clsMore\</span><span style="color: #000000;">""</span><span style="color: #000000;">;<br /> <br /> clsHtml</span><span style="color: #000000;">+=</span><span style="color: #000000;">"</span><span style="color: #000000;">></span><span style="color: #000000;">"</span><span style="color: #000000;">+</span><span style="color: #000000;">Tag</span><span style="color: #000000;">+</span><span style="color: #000000;">"</span><span style="color: #000000;"></div></a></span><span style="color: #000000;">"</span><span style="color: #000000;">;<br /><br /> }<br /> <br /> document.getElementById(</span><span style="color: #000000;">"</span><span style="color: #000000;">Frame2</span><span style="color: #000000;">"</span><span style="color: #000000;">).innerHTML</span><span style="color: #000000;">=</span><span style="color: #000000;">clsHtml;<br /><br /> }<br /> <br /> <br /> </span><span style="color: #0000ff;">function</span><span style="color: #000000;"> setData2(XmlData)<br /> { <br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> clsHtml</span><span style="color: #000000;">=</span><span style="color: #000000;">""</span><span style="color: #000000;">;<br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> clsNode </span><span style="color: #000000;">=</span><span style="color: #000000;"> XmlData.getElementsByTagName(clsId)[</span><span style="color: #000000;">0</span><span style="color: #000000;">]; </span><span style="color: #008000;">//</span><span style="color: #008000;">Erct</span><span style="color: #008000;"><br /></span><span style="color: #000000;"> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> clsChildNode </span><span style="color: #000000;">=</span><span style="color: #000000;"> clsNode.childNodes;</span><span style="color: #008000;">//</span><span style="color: #008000;"><Item></Item><Item></Item><Item></Item>...</span><span style="color: #008000;"><br /></span><span style="color: #000000;"> <br /> </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">var</span><span style="color: #000000;"> j</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;j</span><span style="color: #000000;"><</span><span style="color: #000000;">clsChildNode.length;j</span><span style="color: #000000;">++</span><span style="color: #000000;">)<br /> {<br /> <br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> ItemNode </span><span style="color: #000000;">=</span><span style="color: #000000;"> clsChildNode[j]; <br /> <br /></span><span style="color: #008000;">//</span><span style="color: #008000;"> var ItemNodeName = ItemNode.nodeName;</span><span style="color: #008000;"><br />//</span><span style="color: #008000;"> var ItemNodeValue = ItemNode.nodeText["Id"];</span><span style="color: #008000;"><br />//</span><span style="color: #008000;"> if(ItemNodeName=="Item")</span><span style="color: #008000;"><br />//</span><span style="color: #008000;"> {</span><span style="color: #008000;"><br />//</span><span style="color: #008000;"> alert(ItemNodeValue);</span><span style="color: #008000;"><br />//</span><span style="color: #008000;"> }</span><span style="color: #008000;"><br /></span><span style="color: #000000;"><br /> </span><span style="color: #0000ff;">if</span><span style="color: #000000;">(ItemNode.nodeName</span><span style="color: #000000;">==</span><span style="color: #000000;">"</span><span style="color: #000000;">Item</span><span style="color: #000000;">"</span><span style="color: #000000;">)<br /> {<br /> </span><span style="color: #0000ff;">var</span><span style="color: #000000;"> ItemNodeChild </span><span style="color: #000000;">=</span><span style="color: #000000;"> ItemNode.childNodes;<br /> <br /> </span><span style="color: #0000ff;">for</span><span style="color: #000000;">(</span><span style="color: #0000ff;">var</span><span style="color: #000000;"> r</span><span style="color: #000000;">=</span><span style="color: #000000;">0</span><span style="color: #000000;">;r</span><span style="color: #000000;"><</span><span style="color: #000000;">ItemNodeChild.length;r</span><span style="color: #000000;">++</span><span style="color: #000000;">)<br /> {<br /> alert(ItemNodeChild[i].nodeName);//<strong><span style="background-color: #ff0000;">问题在这里,我怎么也读不到节点值<br /></span></strong> }<br /> }<br /><br /> <br /> <br /> <br /> <br /> <br /> <br /></span><span style="color: #008000;">//</span><span style="color: #008000;"> var Id = ItemNode.getElementsByTagName("Id")[0].firstChild.nodeValue;</span><span style="color: #008000;"><br />//</span><span style="color: #008000;"> var Tag = ItemNode.getElementsByTagName("Tag")[0].firstChild.nodeValue;</span><span style="color: #008000;"><br />//</span><span style="color: #008000;"> var More = ItemNode.getElementsByTagName("More")[0].firstChild.nodeValue; </span><span style="color: #008000;"><br />//</span><span style="color: #008000;"> </span><span style="color: #008000;"><br />//</span><span style="color: #008000;"> clsHtml+="<a href=\"ClsSelect.aspx?Ids="+Id+"\"><div";</span><span style="color: #008000;"><br />//</span><span style="color: #008000;"> if(More=="true")</span><span style="color: #008000;"><br />//</span><span style="color: #008000;"> clsHtml+=" class=\"clsMore\"";</span><span style="color: #008000;"><br />//</span><span style="color: #008000;"> </span><span style="color: #008000;"><br />//</span><span style="color: #008000;"> clsHtml+=">"+Tag+"</div></a>";</span><span style="color: #008000;"><br /></span><span style="color: #000000;"><br /> }<br /> <br /> document.getElementById(</span><span style="color: #000000;">"</span><span style="color: #000000;">Frame2</span><span style="color: #000000;">"</span><span style="color: #000000;">).innerHTML</span><span style="color: #000000;">=</span><span style="color: #000000;">clsHtml;<br /><br /> }<br /></span></div></pre>
</div>
</div>
<p> </p>
<p>Html代码:</p>
<p> </p>
<p> <div class="ClsSelect"><br /> <br /> <div class="SelectFrame" id="SelectFrame"><br /> <div class="Frame1" id="Frame1"><br /> <div class="ItemDiv cls1 cls" id="Erect"><div><div class="Item">装修建材</div><div>装修/浴室/厨房/卧室/门窗</div></div></div><br /> <div class="ItemDiv cls2 cls" id="House"><div><div class="Item">家居用品</div><div>电视机/洗衣机/冰箱/电脑</div></div></div><br /> <div class="ItemDiv cls3 cls" id="MaMiBaby"><div><div class="Item">妈咪宝贝</div><div>母婴/奶粉/玩具/童装/孕妇</div></div></div><br /> <div class="ItemDiv cls4 cls" id="Marry"><div><div class="Item">偶要结婚</div><div>婚戒/婚宴/婚庆/婚照/蜜月</div></div></div><br /> </div><br /> <div class="Frame2" id="Frame2"><br /> <%-- <a href="ClsSelect.aspx?Id=" ><div>Tag</div></a><br /> <a href="ClsSelect.aspx?Id=" ><div class="clsMore">Tag</div></a><br /> <a href="ClsSelect.aspx?Id=" ><div class="clsMore Selected">Tag</div></a><br /> <a href="ClsSelect.aspx?Id=" ><div class="Selected">Tag</div></a>--%><br /> </div><br /> <div class="Frame2" id="Frame3"> <br /> <ul><br /> <li></li><br /> <li></li><br /> <li></li><br /> <li></li><br /> <li></li><br /> </ul><br /> <br /> </div><br /> <div class="Frame3" id="Frame4"><br /> <ul><br /> <li></li><br /> <li></li><br /> <li></li><br /> <li></li><br /> <li></li><br /> </ul><br /> </div><br /> </div><br /> <br /> </div></p>
<p> </p>
<p>我做了浏览器的判断,在IE下能正常显示,但是在chrome下,怎么也读不到节点的值,不知道有没有谁能帮忙解决下</p>
海底的鱼
|
初学一级
|
园豆:
77
提问于:2010-06-08 11:44