[英]Why chrome doesn't show my xml file processing result?
I'm making a web page using JS and JQuery with HTML and CSS , this webpage considered to extract some data from an XML file and display it as a drpodown menu , I'm using a JQuery library called HeapBox as a customized dropdown menu.. every thing goes OK when dealing with firefox : 我正在使用JS和JQuery以及HTML和CSS制作网页,该网页被认为是从XML文件中提取一些数据并将其显示为drpodown菜单 ,而我使用的是名为HeapBox的JQuery库作为自定义下拉菜单。在处理Firefox时一切正常:
but when coming to chrome the xml data didn't shown: 但是当使用chrome时,没有显示xml数据 :
$('#dummy').load('cafe.xml',function() { // dummy is a regular Div <div id="dummy> </div>
initialize();
})
function initialize(){
ct=$('menu').children().length;
for(var cati=0;cati<=ct-1;cati++)
{
cats[cati]=$('menu').children().eq(cati).prop('nodeName');
$('.basic-example').append('<option id="option1" value="option1">'+realname+'</option>'); //.basic-example is a heapbox integrated class
}
$(".basic-example").heapbox({'onChange':function(){loadmenu()},effect:{type:"fade",speed:"slow"}});
}
More interesting than the code here is the adressbar partially visible in the first screenshot. 比这里的代码更有趣的是在第一个屏幕截图中部分可见的地址栏。 You are running this on local filesystem, but chrome doesn't allow AJAX on local filesystem.
您正在本地文件系统上运行此程序,但是chrome不允许在本地文件系统上使用AJAX。
Use a webserver to test your application. 使用网络服务器测试您的应用程序。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.