The Artima Developer Community
Sponsored Link

Agile Buzz Forum
data: URI's (rfc 2397)

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
data: URI's (rfc 2397) Posted: Dec 13, 2005 5:29 AM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: data: URI's (rfc 2397)
Feed Title: Michael Lucas-Smith
Feed URL: http://www.michaellucassmith.com/site.atom
Feed Description: Smalltalk and my misinterpretations of life
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Michael Lucas-Smith

Advertisement

It's interesting that little nugget of technology isn't supported by Firefox yet it is supported by Internet Explorer. I wonder how they missed that at the Mozilla team?

data: URI's allow you to put data 'inline' in your document. That data can be images, sound, even html - anything really, since the mime/type is actually part of the URI as well.

A simple data: URI might look like this: data:text/plain,Hello+World! - the idea being that it is still URI encoded but that the data after the , is the actual package of data. A slightly more complicated one might look like this: data:text/html,<div>Hello+World!</div>

You can also include character set information in the URI and data: URI's are also able to handle base64 encoding of the data. So you end up with slightly more complicated examples such as:

data:image/gif;base64,R0lGODdhMAAwAPAAAAAAAP///ywAAAAAMAAw AAAC8IyPqcvt3wCcDkiLc7C0qwyGHhSWpjQu5yqmCYsapyuvUUlvONmOZtfzgFz ByTB10QgxOR0TqBQejhRNzOfkVJ+5YiUqrXF5Y5lKh/DeuNcP5yLWGsEbtLiOSp a/TPg7JpJHxyendzWTBfX0cxOnKPjgBzi4diinWGdkF8kjdfnycQZXZeYGejmJl ZeGl9i2icVqaNVailT6F5iJ90m6mvuTS4OK05M0vDk0Q4XUtwvKOzrcd3iq9uis F81M1OIcR7lEewwcLp7tuNNkM3uNna3F2JQFo97Vriy/Xl4/f1cf5VWzXyym7PH hhx4dbgYKAAA7

That is a picture I ripped off the Wikipedia on this subject. So now WithStyle supports these little beasts and coincidently so does NetResources. So if you load up the latest NetResources from public store (v1.90) you will be greeted with the ability to do data URI's yourself.

Better yet, you'll also be able to POST to them too, so the following actually works:

('data:text/plain,Hello' asURI post: 'Cya' encoding: 'utf8') asString = 'data:text/plain;charset=utf8,Cya'

Enjoy!

Read: data: URI's (rfc 2397)

Topic: More web consolidation Previous Topic   Next Topic Topic: Microsoft finds their way to 1985

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use