0

I am now using the latest Webstorm IDE for developing the webpage with 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.

2. To read a local xml file, I use the Webstorm function in following image.

finally, I success the reading a local xml file.

enter image description here

  • What is difference between "number1 method" and "number2 method"?

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>

JaeYoungHwang
  • 99
  • 1
  • 4
  • 11

1 Answers1

0

It is because of Same-origin policy, you can reference to below links:

Community
  • 1
  • 1
hegfirose
  • 311
  • 4
  • 6