Created
July 23, 2011 20:17
-
-
Save ggoodman/1101836 to your computer and use it in GitHub Desktop.
buildSaveURL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| buildSaveURL = function(content, mime) { | |
| // Better feature detection would be needed for portability | |
| urlBuilderBase = window.createObjectURL ? window : window.webkitURL; | |
| // Create and fill the blob | |
| bb = new BlobBuilder(); | |
| bb.append(content); | |
| // Create and return the blog url | |
| return urlBuilderBase.createObjectURL(bb.getBlob(mime)); | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
urlBuilderBasecan also beURL, andBlobBuildercan also beWebKitBlobBuilderorMozBlobBuilder.