In a certain area of my site, the user can select a few rows from the database to export them to a JSON, after selecting all that they want an Ajax call is made to get the data of the same, however inside the return How do I download it? For example:
jQuery.ajax({
type: "POST",
url: "seleciona-dados.php",
data:{data: ids},
success: function(data){
//data já irá vir em formato JSON pelo PHP, como faço o download do mesmo para um arquivo?
}
});