Just wanted to provide more detail on WCF WebAPI out-of-the-box support for JSONP. I had a really hard time finding this information, so perhaps it will help somebody else...
This thread over on the WCF CodePlex has a description by Daniel Roth about how to use WebApi cross-domain JSON queries (a.k.a JSONP) using jQuery.
The "sample" he references can be found in the WCF CodePlex repository here. It is in the "default" folder.
Also, make sure you install the WebApiEnhancements for Preview 6 using NuGet otherwise none of this will work.
You'll need a Global.asax.cs with something like the following...
public class Global : System.Web.HttpApplication
{
protected void Application_Start()
{
var config = new WebApiConfiguration() { EnableTestClient = true };
RouteTable.Routes.MapServiceRoute<HelloWorldApi>("api", config);
}
}
The other key is to account for an "extension" in your URI template...
[WebGet(UriTemplate="hello{ext}")]
Then you make your jQuery call like this...
$.getJSON("/api/hello.jsonp?callback=?", function (data) {
$("div").html(data);
});