I'm using ajax call to load data to my application. its working fine for paths like this
../../DataSource/newJson.json
but it doesn't work for the path like this.
C:\Users\acer\Desktop\NewJson.json
I have searched a lot but i didn't find any proper solutions to my question. I'm using the following code to load the file from the local directory.
<button id="loadData">update new Json</button>
<input type="file" id="newJson" value="file" />
Here is my ajax call:
$("#loadData")[0].onclick= function (e){
$.holdReady(true);
var request = $.ajax({
type: "GET",
dataType: 'json',
url: $("#newJson").val(),
success: function (data) {
alert('success')
},
error: function (data, dat1, error) {
alert(error)
}
});
};
Any suggestions should be appreciated.