Labs/Jetpack/JEP/10: Difference between revisions

Line 77: Line 77:
E.g., plain, html, png, gif, video/ogg, audio/ogg
E.g., plain, html, png, gif, video/ogg, audio/ogg


On the flip side. Everything after the "/" can be omitted if you don't care about a specific type being retruend. Jetpack will choose an available match given a possibly arbitrary ordering MIME-types (e.g., if you pass in "image" Jetpack may return a "png"). This enables an author to simple write <code>var img = jetpack.os.clipboard.get( "image" );</code> and not have to worry about what particular image format the clipboard was storing the image in.
On the flip side. Everything after the "/" can be omitted if you don't care about a specific type being returned. Jetpack will choose an available match given a possibly arbitrary ordering MIME-types (e.g., if you pass in "image" Jetpack may return an image in PNG format). This enables an author to simple write <code>var img = jetpack.os.clipboard.get( "image" );</code> and not have to worry about what particular image format the clipboard was storing the image in.


''Odd footnote: It appears in the documentation for the clipboard on MDC that there exists a "text/unicode" flavor. However, I can find no mention of it in the Internet media type spec.''
''Odd footnote: It appears in the documentation for the clipboard on MDC that there exists a "text/unicode" flavor. However, I can find no mention of it in the Internet media type spec.''
577

edits