Spry

Prepare your files

Before you begin creating JSON data sets, obtain the necessary files (SpryJSONDataSet.js and SpryData.js). The SpryJSONDataSet.js file lets you use JSON code as your data source; the SpryData.js file contains the Spry data library.

Link both files to whatever HTML page you’re creating.

  1. Download and unzip the Spry ZIP file from the Adobe Labs website to your hard drive.
  2. Open the unzipped Spry folder and locate the includes folder. This folder contains the SpryJSONDataSet.js and SpryData.js files necessary for creating JSON data sets.
  3. Copy the includes folder and either paste or drag a copy of it to the root directory of your web site.
    Note: If you drag the original includes folder out of the unzipped Spry folder, the demos in the Spry folder won’t work properly.
  4. Link the Spry data library files to your web page by inserting the following script tags within the page’s head tag:
    <script type="text/javascript" src="includes/SpryData.js"></script>
    <script type="text/javascript" src="includes/SpryJSONDataSet.js"></script>

    When you’ve linked the Spry data library, you can create a Spry data set.

  5. Add the Spry name-space declaration to the HTML tag so that the HTML tag looks as follows:
    <html xmlns="http://www.w3.org/1999/xhtml" xmlns:spry="http://ns.adobe.com/spry/">

    The Spry name space declaration is necessary to validate the code anytime you use a Spry attribute (such as spry:region).

    Note: Spry features work locally as long as the Spry data library files are linked to your HTML page. To publish the HTML page to a live server, upload the SpryJSONDataSet.js and SpryData.js files as dependent files.