Supporting JSONP callbacks in WCF Data Services

By default, WCF Data Services does not support the $format and $callback options to support JSONP.

If you're using datajs to access a service and have set the enableJsonpCallback flag to true but you're seeing an error on the response that looks like "The query parameter '$callback' begins with a system-reserved '$' character but is not recognized." (you'll need a network capture to see this), then the server doesn't support JSONP. Thanks to Marco Bettiolo for the problem report and network diagnostics!

A very common way to add support is described by Pablo Castro in this blog post, or if you prefer to get up and running faster, the sample is here.

Enjoy!