Skip to content
jQuery plugin to capture and download the DOM.
Find file
New pull request
Latest commit f8a925a @talos The data: uri specification makes no leeway for file names or download
content types.  Making this explicit in the documentation.

closes #1
closes #2


This jQuery plugin uses the data: URI to download the DOM of arbitrary elements into files. One file will be downloaded for each selected element. Since the DOM is captured, any javascript-generated content will be included in the download.

See it in action.


failCallback: (Optional) The browser may not support the data: URI. If this is the case, this function will be called once with the text of each element not downloaded.


There is also a utility function you can use to check whether the browser supports the data URI. This will return true if there is support, and false otherwise.



This will download into a browser-named file the contents of the current page view:


This would download every svg on the page into a separate file:


This takes advantage of failCallback in case the browser doesn't support the data: uri.

    var failCallback = function(text) {
      alert("Could not download " + text);


It is not possible to specify a name for the downloaded file. If at some point arbitrary headers are added to the data: uri spec, this would be possible using Content-Disposition with filename.

There was some discussion about this on the, but it has not led to any change in the spec.

Any browsers with limited data: uri support will not work, either. The failCallback is your friend.


Fork it from

CDN it at

Something went wrong with that request. Please try again.