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