xml文件:js代碼如下:html代碼如下:<body>
<h3>請在下面的輸入框中輸入用戶名:</h3>
<form>
<label>用戶名:</label><input type="text" id="user_input" value="" onkeyup="showHint(this.value)" />
</form>
<p>密碼:<span id="psd_text"></span></p> </body>在w3school學(xué)習(xí)到一個例子,就想改一下成輸入用戶名,然后在xml文件里查找包含這個用戶名的節(jié)點,最后顯示密碼。谷歌瀏覽器中總是報錯:Cannot read property 'documentElement' of null。而火狐報錯:xmlhttp.responseXML is null。搞了很久搞不定,上來求幫忙。
請教一個關(guān)于Ajax讀取xml文件的問題?
DIEA
2018-11-24 13:15:04