Sunday, January 25th, 2009
jData: pseudo-globalStorage for browsers
<p>Elijah Grey has created an open source implementation of a psuedo-globalStorage[''] called jData that works in Firefox 3+, WebKit Nightlies, and IE8 beta 2. We asked him to tell us more:globalStorage[''] was supposed to be a globally shared storage interface but was too insecure due to every host having write access. Read access is unrestricted and write access require either user confirmation or a previously accepted request for the host to be trusted so the localStorage can not be abused. I implemented by using postMessage and localStorage (or globalStorage[location.host] in the case of Firefox) on a certain host to share it's localStorage will all of the internet. The format for communication between client and host is JSON and has a standard format for sending and responding.
I have also made a reference interface library named JIL (jData Interface Library) that provides a simple way to use jData. I have created a standard for what items should be named so stuff like 'openid' is always the item being set to set a user's OpenID address.
There are a few different types of requests that can be sent to jData, and they are explained and easy to understand in the API reference.Here are some examples of how someone might use this:
website 1:
HTML:
function setOpenID(openidURI) { JIL.get('openid', function(oi) { if ( oi == null ) JIL.set('openid', openidURI); } } ... <form ... onsubmit="setOpenID(openid.value);return false;">website 2:
JAVASCRIPT:
JIL.get('openid', function(openid) { if ( openid !== null ) autoLogOnWithOpenID(openid); })
NOTE: Obvious security issues within.
Related Content:











Could you remove the “(first . I don’t want to say it in this email because >3 links causes some spamfilters to flag the message as spam.” part? You can link “API reference” to http://eligrey.com/projects/jdata/jdata-standard/ if you want to. Thanks.
Sorry, I copy & pasted the wrong URL. I meant to say about linking “API Reference” to http://eligrey.com/projects/jdata/jdata-api-reference/
Hi, i like it .. but i don t find a demo page… where is it?
@nunziofiore http://code.eligrey.com/jdata/jil/demo.html
thank you very much… mit was linked :-O i m so blind…
:)
it doesn t run with chrome
@nunziofiore the release builds of Google Chrome don’t support postMessage (they do support localStorage though).
You need to use a Google Chrome nightly build to try it on chrome.
great EliGrey… it runs like a ferrari ;)
I think i’ll use it in some of my web app…
bye
Nunzio Fiore