简体   繁体   English

在Webstorm IDE中读取本地xml文件。(+ node.js,ajax)

[英]Reading a local xml file in Webstorm IDE.(+ node.js, ajax)

I am now using the latest Webstorm IDE for developing the webpage with Ajax. 我现在使用最新的Webstorm IDE来通过Ajax开发网页。

1. To read a local xml file, I start the server and access the localhost with chrome but I didn't read a local xml file. 1.要读取本地xml文件,我启动服务器并使用chrome访问localhost,但没有读取本地xml文件。

2. To read a local xml file, I use the Webstorm function in following image. 2.要读取本地xml文件,请使用下图中的Webstorm功能。

finally, I success the reading a local xml file. 最后,我成功读取了本地xml文件。

在此处输入图片说明

  • What is difference between "number1 method" and "number2 method"? “ number1方法”和“ number2方法”之间有什么区别?

Thank you in advance!! 先感谢您!!

========================================================================== ================================================== ========================

<script type="text/javascript"> $(function () { $('#resourceName').click(function() { $.ajax({ url: "ResourceFormat/xml/test.xml", type: "get", dataType: "text", cache: false, timeout: 30000, success: function(data) { $('#bodyText').val(data); }, error: function(xhr, textStatus, errorThrown) { alert(textStatus + ': ' + xhr); } }); }); }); </script>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM