【发布时间】:2012-10-12 09:55:27
【问题描述】:
我有以下方法,但在 Opera 和 Google Chrome 中不起作用。我需要在 CD 上离线读取 xml 文件。我该如何解决这个问题?
$(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');
});
}
});
});
【问题讨论】:
标签: xml ajax google-chrome opera