简体   繁体   English

为什么Chrome无法显示我的xml文件处理结果?

[英]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 : 我正在使用JSJQuery以及HTMLCSS制作网页,该网页被认为是从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.

相关问题 为什么我的扩展程序不会显示在Chrome网上应用店搜索结果中? - Why doesn't my extension show up in Chrome Web store search result? 为什么我的JavaScript XML处理代码无法在Safari中工作? - Why doesn't my JavaScript XML processing code work in Safari? 为什么我的控制台不显示基于以下代码的结果 - Why doesn't my console show a result based on code below 为什么我的Chrome Profiler没有为我的对象显示正确的保留路径,为什么我的对象永远不会被释放? - Why doesn't my Chrome Profiler show proper retaining paths for my objects, and why are my objects never released? Javascript processing.js为什么图片不显示? - Javascript processing.js Why the image doesn't show up? 为什么这不在我的网站上显示为链接? - Why doesn't this show as a link on my site? 为什么我的bootstrap popover没有显示? - Why my bootstrap popover doesn't show? 为什么我的画布动画不显示? - Why doesn't my canvas animation show? 为什么我的范围没有显示指令? - Why doesn't my scope show with a directive? 为什么在我运行该Processing / Processing.js草图时不显示它? - Why doesn't this Processing/Processing.js sketch show when I run it?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM