JSONP / Export to Excel [closed]
We're using JSONP (cross-site request) request with JQuery to开发者_高级运维 retrieve data from our server; everything is fine.
But now we need to retrieve an Excel file; any idea / pointer on how to do that (we're using Firefox).
Thx.
You could setup a server side handler on the remote domain which will serve the Excel file and append the Content-Disposition: attachment; filename=foo.xlsx
HTTP header so that the browser opens a Save As dialog. Now all that's left is provide the user with some link to download the file:
<a href="http://remotedomain.com/file">Download Excel file</a>
No javascript is required.
精彩评论