Archive for the 'JSON' Category
OK, this is nothing shockingly new, but I found it pretty useful. Using jQuery, Ajax has become more or less a one-liner:
PLAIN TEXT
JAVASCRIPT:
$(document).ready(function(){
$(’.ajaxtrigger’).click(function(){
$(’#target’).load($(this).attr(’href’));
return false;
});
});
This loads the document any link with a class of “ajaxtrigger” points to and updates the content of the element with the ID “target”. If [...]
January 11th, 2010 | Posted in AJAX, Front Page, JSON, JavaScript, Miscellaneous, XmlHttpRequest, Yahoo!, crossdomain, jQuery, json-p, json-p-x, yql | Comments Off
Lloyd Hilaiel of Yahoo! BrowserPlus fame, has a little holiday gift for us. He has created a simple library called Orderly that “is a textual format for describing JSON. Orderly can be compiled into JSONSchema. It is designed to be easy to read and write.”
He shares:
A little bit of orderly…
PLAIN TEXT
JAVASCRIPT:
object {
string name;
string [...]
December 23rd, 2009 | Posted in Front Page, JSON, JavaScript, Library, Miscellaneous | Comments Off
Kris Zyp, JSON hero, has been cooking up some more good stuff on his path to reinventing a new path to all.
In JSON namespacing he discusses JSON Hyper Schema which aims to cure JSON from XML namespacing colon cancer.
JSON Hyper Schemas can be referenced from instances by Link headers or media type parameters. A simple [...]
September 9th, 2009 | Posted in Front Page, JSON, Miscellaneous | Comments Off
An interesting piece by Neil Fraser shows that using JSON-P with generated script nodes can be quite a memory leak. Normally you’d add information returned from an API in JSON-P with a generated script node:
PLAIN TEXT
JAVASCRIPT:
script = document.createElement(’script’);
script.src = ‘http://example.com/cgi-bin/jsonp?q=What+is+the+meaning+of+life%3F’;
script.id = ‘JSONP’;
script.type = ‘text/javascript’;
script.charset = ‘utf-8′;
// Add the script [...]
July 28th, 2009 | Posted in Front Page, JSON, JavaScript, Miscellaneous, Performance, json-p, memory, webservices | Comments Off
Yesterday’s announcement of Yahoo’s YQL now supporting insert, update and delete overshadowed another interesting new feature: JSONP-X output.
Here’s what it is and why it is useful: YQL data can be returned in XML which is annoying to use in JavaScript (for starters because of crossdomain issues in Ajax). JSON is much easier as it [...]
July 9th, 2009 | Posted in Front Page, JSON, JavaScript, Miscellaneous, Yahoo!, api, json-p, jsonp-x, outputformat, yql | Comments Off
As preparation for an upcoming tech talk about Placemaker I thought it would be good to take a bit of the pain out of the geolocation service by making an interface for it. Placemaker works the following way: you post some content or a URL to it, it goes through the content or gets the [...]
July 2nd, 2009 | Posted in Front Page, JSON, JavaScript, Miscellaneous, Yahoo!, api, geo, geolocation, placemaker, wrapper | Comments Off
Robert Nyman has setup a really nice test suite for JavaScript 1.6, 1.7, and 1.8+ features such as getters/setters, Object.defineProperty, Object.getPrototypeOf, new String extras, and JSON.
It includes compatibility tables, and will try to run the tests on your browser to give you feedback. It also includes sample code to check web browser support that you [...]
June 18th, 2009 | Posted in Front Page, JSON, JavaScript, Miscellaneous | Comments Off
I just looked through the API of Microsoft’s new Bing search and found an interesting step in protecting code from throwing errors.
When you provide a JSON output for developers it does make sense to also allow for a callback parameter. That way your code can be used in script nodes without having to use any [...]
June 15th, 2009 | Posted in Front Page, JSON, JavaScript, Library, Microsoft, Miscellaneous, api, bing, callback, padding | Comments Off
Kris Zyp recently posted about an intriguing new chapter in the application persistence space:
The latest beta of Persevere features a new native object storage engine called JavaScriptDB that provides high-end scalability and performance. Persevere now outperforms the common PHP and MySQL combination for accessing data via HTTP by about 40% and outperforms CouchDB by 249%. [...]
April 21st, 2009 | Posted in Database, Front Page, JSON, JavaScript, Miscellaneous | Comments Off
Atul Varma, a fantastic colleague in Building “S” at Mozilla, has been playing with a JavaScript implementation of CouchDB called BrowserCouch:
BrowserCouch is an attempt at an in-browser MapReduce implementation. It’s written entirely in JavaScript and intended to work on all browsers, gracefully upgrading when support for better efficiency or feature set is detected.
Not coincidentally, [...]
April 21st, 2009 | Posted in Database, Front Page, JSON, JavaScript, Library, Miscellaneous | Comments Off