This repository has been archived by the owner on Aug 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Home
egil edited this page Sep 14, 2010
·
6 revisions
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.
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);
});
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
andPOST
supported with JSONP (this might be a limitation in the way jQuery allows you to query JSONP services sincebeforeSend
is never called whendataType === '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.