1
我有以下方法,但它在Opera和Google Chrome中不起作用。我需要在CD上離線閱讀xml文件。我怎樣才能解決這個問題?ajax Opera和Chrome bug
$(document).ready(function(){
$.ajax({
type: "POST",
url: "items.xml",
dataType: "xml",
success: function(xml) {
$(xml).find('item').each(function(){
var id = $(this).find('id').text();
var name = $(this).find('name').text();
var alcohol = $(this).find('alcohol').text();
var volume = $(this).find('volume').text();
$('<div class="items" id="link_'+id+'"></div>').html('<a href="files/'+name+'">'+name+'</a>').appendTo('#page-wrap');
});
}
});
});
Opera 12.02,Google Chrome 22.0.1229.94m –
XML在這裏http://jsfiddle.net/SejberCze/wdsCX/應該沒有錯誤。 –
什麼工作不正確?你能提供任何額外的細節嗎? 我添加了你的XML到我的測試中,它仍然有效。 http://jsfiddle.net/SgUKY/1/ – fearphage