I am sending POST data via ajax using jQuery and returning the binary data of a PDF file.
I would like to do something with this data. Either by providing a download link, or by opening a new tab / window.
I know that sending a user to a site and using GET variables will be easier, but there is a lot of data that is sent through him, and this should be a message.
Is there a way to take the data I get and allow the user to load / see it somehow?
$("#export_pdf").click(function()
{
var data_serialize = "v1=blah&var2=again&var3=more_info",
url = "/actions/export-pdf";
$.ajax({
type: "POST",
url: url,
data: data_serialize,
success: function(data)
{
},error: function(data) { alert("error"); }
});
});
source
share