I am fairly new to AJAX. I am sending a request to server using AJAX. The service returns a text file. But no download box appears when data is returned. The rest service t
A) you don't have a callback to receive data back
b) Add error callback to you code so you can see if there are receiving errors after the call:
$.ajax({
url: '/spaconsole/rest/examples/getcode',
type: 'POST'
success: function (data) {
console.log('ok');
},
error: function (xhr) {
console.log(xhr);
}
});
Edit: This is if you want to display the text in page. If you want to download the file, this is not the way, you cannot use ajax