Skip to content

Instantly share code, notes, and snippets.

@alexyork
Created August 30, 2010 12:28
Show Gist options
  • Save alexyork/557343 to your computer and use it in GitHub Desktop.
Save alexyork/557343 to your computer and use it in GitHub Desktop.
// Calling a WCF Data Service with jQuery
//
// This will generate a URL like this...
// http://example.com/Products.svc/Customers(1234)/Orders?$skip=10&top=10
// ... and pass the JSON data result to your callback function
$.fromServiceUrl("http://example.com/Products.svc")
.queryTable("Customers", 1234)
.withRelation("Orders")
.skip(10)
.take(10)
.onSuccess(successCallback)
.onError(errorCallback)
.run();
// Of course, your callback function can be using jQuery templating
// to render the JSON to HTML
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment