Difference between revisions of "Widget:DataExporter"

From LINKS Community Center
Jump to: navigation, search
Line 57: Line 57:
  
 
                 fetch('/api.php?' + exportParams.toString());
 
                 fetch('/api.php?' + exportParams.toString());
 +
 +
                const dl = document.createElement('a');
 +
                dl.href = '/api.php?' + exportParams.toString();
 +
                dl.download = 'export.' + formData.get('fileformat');
 +
                document.body.appendChild(dl);
 +
                dl.click();
 +
                document.body.removeChild(dl);
  
 
                 // exportUrl = '/api.php?action=ask&format=spreadsheet&query=[[Category:Disaster Community Technology]]';
 
                 // exportUrl = '/api.php?action=ask&format=spreadsheet&query=[[Category:Disaster Community Technology]]';

Revision as of 11:13, 17 August 2023