Skip to content
This repository has been archived by the owner on Aug 6, 2020. It is now read-only.
egil edited this page Sep 14, 2010 · 6 revisions

jQuery.OData

This is a small OData plugin for jQuery. The primary features include query building using dot notation, reusable queries and the ability to perform queries similar to jQuerys getJSON method.

jquery.odata stands at about 9 KB in the minified version and about 32 KB uncompressed.

Simple example

This queries a service located at the uri ‘/services/AdventureWorks.svc/’ for the 10 first entries in the ‘Products’ collection.

$.odata('/services/AdventureWorks.svc/')
    .from('Products')
    .top(10)
    .query(function(result){
        // do interesting stuff with result
        console.log(result);
    });

Known issues / missing features

The plugin is still under development, and there are still some functionality that is missing or not working:

  • No batch mode implemented yet.
  • $count and $value not supported with JSONP.
  • Only GET and POST supported with JSONP (this might be a limitation in the way jQuery allows you to query JSONP services since beforeSend is never called when dataType === 'jsonp', making it impossible to modify headers. A solution may be to create the xhr object manually).
  • No direct updates of links implemented yet. If a services provides relationship IDs in the entries, links can be changed by changing the relationship IDs.
Clone this wiki locally