O'Reilly logo

HTML5 Data and Services Cookbook by Mite Mitreski, Gorgi Kosev

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Data URI

We have already used on several occasions Data URI (Uniform resource identifier) throughout this book, but never got into details on what can we use it for as well as what are the limitations. Data URI are often referred to as Data URL (Uniform Resource Locator) though technically speaking they don't actually locate anything from a remote site.

In this example, we will use different media types and check the size constraints.

Getting ready

We will only need browser and some sample text files for this example. The files can be downloaded as part of the files folder in the example files.

How to do it...

In order to see some of the options available we will create a simple HTML file with few different use scenarios:

  1. The head section will include ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required