4
我從XML文件中檢索數據,然後使用jQuery .find()函數來訪問該數據。然而,在Firefox(版本37.0.2)我得到的JavaScript控制檯以下錯誤:jQuery調用查找函數給出了一個「格式不正確」的錯誤Firefox
Error: Unable to run script because scripts are blocked internally.
Error: not well-formed
Source Code:
<datarecord><div><a id='sizzle1430853521804'></a><select id='sizzle1430853521804- ]' msallowcapture=''><option selected=''></option></select></
一切仍然工作正常,但沒有人知道我怎樣才能擺脫這種錯誤的,或者是一個錯誤在Firefox?
這裏是我的代碼:
$.ajax({
url:"file.xml",
type:"GET",
dataType:"xml",
success:function(xml){
$(xml).find("field_id").each(function(){
// my code...
}
}
});
的XML文件格式如下,我已經使用了XML驗證,以確保它是確定:
<?xml version="1.0" encoding="utf-8"?>
<datarecord>
<field_id><TheIdValue>8</TheIdValue><TheDisplayValue>Joe Bloggs</TheDisplayValue></field_id>
etc...
</datarecord>
我一直沒能找到解決方案。有什麼建議麼?
可能的重複[XML解析錯誤:在FireFox中不完整,但在Chrome中很好](http://stackoverflow.com/questions/7642202/xml-parsing-error-not-well-formed-in-firefox - 但在鉻合金) –
不,這是一個不同的問題。 – Stevio
你的xml中有'