I have following scripts that retrieves the data from a sharepoint list view. I can get the data and display but i want to download the data in json file. Everytime any users hits the page which has this scripts it prompts them to save the JSON file.
here is my script fuction that outputs the data in json format. i just need to create a json file out of that data and download it as a file
getListViewItems('https://mysite','mylist','myview').done(function(data)
{
console.log(JSON.stringify(data));
// data is the json result i want and i can print this to
// console or display in the page but i want to add this to
// a json file and make it downloadable.
})
.fail(
function(error){
console.log(JSON.stringify(error));
});