HTRAF Toolkit

HTRAF is a toolkit for embedding data into HTML pages. With HTRAF, you can associate certain HTML elements with data sources — when the page is opened in a browser, HTRAF fetches the data from the database and displays it on the page.

HTRAF is based upon JQuery Javascript framework and relies on an HTSQL service to retrieve data from the database. HTRAF is written by Owen McGettrick and Oleksiy Golovko and released under dual MIT/GPL license.

Quick Start

Download HTRAF

Download the latest build of HTRAF from:

Include the framework

Include the script htraf.js to your HTML pages and associate it with an HTSQL service:

 <script type="text/javascript"
     src="/htraf/htraf.js"
     data-htsql-version="2"
     data-htsql-prefix="/@demo">
 </script>
[- view demo]

Select data sources

Construct HTSQL queries to serve as data sources for HTML elements:

name count(program) count(department)
School of Art & Design 3 1
School of Business 6 3
College of Education 7 2
School of Engineering 8 4

Attach the sources to HTML elements

Use attribute data-htraf to populate the element with the result of the query:

 <table data-htsql="/school{name,count(program),count(department)}">
 </table>
[- view demo]