

CORS is a mechanism allowing a web application at one domain If your "Save to Drive" button is on a separate page from the data source, theĬross Origin Resource Sharing (CORS) to access Handle buttons and resources on different domains If multiple different buttons are clicked, they save If the data-src and data-filename parameters are the same for multipleīuttons, saving from one button causes all similar buttons to display the same You might have a button at the top and at the bottom of a long page. You can place multiple "Save to Drive" buttons on the same page. The data is discarded and no file is created in Google Drive. Note: If the user navigates away from the page before the download is complete, The "Save to Drive" button can be wrapped inĪnother element to make the initial layout look similar to the final layout. You can also load the scriptĪsynchronously for improved performance. This script must be loaded using the HTTPS protocol and can be includedįrom any point on the page without restriction. Slightly differently while the page is loading because the browser renders theĮlement before the "Save to Drive" JavaScript re-renders the element. You may place these attributes on any HTML element. Protocol based on how the hosting page was accessed.ĭata-filename is a required parameter containing the name used for theĭata-sitename is a required parameter containing the name of the web site Specify the resource without a protocol such asĭata-src="///files/file.pdf", which uses the appropriate
