【问题标题】:Reading a local xml file in Webstorm IDE.(+ node.js, ajax)在 Webstorm IDE 中读取本地 xml 文件。(+ node.js, ajax)
【发布时间】:2016-06-06 21:42:22
【问题描述】:

我现在使用最新的 Webstorm IDE 来开发带有 Ajax 的网页。

1. 为了读取本地 xml 文件,我启动服务器并使用 chrome 访问 localhost,但我没有读取本地 xml 文件。

2. 为了读取本地 xml 文件,我使用了下图中的 Webstorm 函数。

终于,我成功读取了一个本地xml文件。

  • “number1 方法”和“number2 方法”有什么区别?

提前谢谢你!!

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

<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>

【问题讨论】:

    标签: javascript html ajax node.js webstorm


    【解决方案1】:
    猜你喜欢
    • 2015-12-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多