Monday, April 23, 2012

Javascript API made easier; no domain management required

The javascript API library for Rdbhost has been updated, and is now even easier to use to access Rdbhost hosted databases from your javascript application. No longer do you need to to set up a domain pointer from a subdomain of your site domain to the rdbhost server.

 Just include the new jquery.rdbhost.exdm.js module in your page, pass your account role and authcode to the $.rdbhostConfig call, and use the provided methods to access your Rdbhost database; the library includes both an SQLEngine class with query methods, and also a jQuery plugin that applies query results to selected element sets.

 The jquery.rdbhost.exdm.js module is based on Oyvind Kinsey's easy-xdm library, which uses a variety of inter-domain messaging techniques to enable returning data from the Rdbhost server to your page on any domain. We do apply CORS domain-checking to prevent unauthorized cross-domain access, but the default CORS authorization provided for new accounts is the wildcard '*' permitting all domains, including localhost. When you finish the app and move it to a public server, specify the domain as a remote host in Rdbhost website management page.

The module is at: https://github.com/rdbhost/Rdb.Js

There are example pages for various API methods at: http://www.paginaswww.com/rdb/examples

The jQuery plugin has been extended to support OpenID logins, as well:
http://github.com/rdbhost/Rdb.js