if this is your *exact* code

$.getJSON(url + "?callback?", function (json) {

then you're missing an equal sign

$.getJSON(url + "?callback=?", function (json) {

As for the rest of your issue of "what to do", this post should help:

http://groups.google.com/group/jquery-en/browse_thread/thread/fd821bf488c9a9d3?hl=en#

On Oct 26, 8:14 pm, Mark Volkmann <r.mark.volkm...@gmail.com> wrote:
> I have some code working that invokes an HTTP service that returns JSON.
> From my JavaScript I call the service with:
>
> $.getJSON(url + "?callback?", function (json) {
>   // do something with json here
>
> });
>
> My service is implemented as a Java servlet with a doGet method.
> In that method I:
> 1) set the content type of the response to "application/x-javascript".
> 2) get the value of the callback parameter
> 3) create a Java Map
> 4) use the org.json library to convert the map to JSON text
> 5) build a string of JavaScript code that calls the callback function,
> passing it the JSON
> 6) write the string of JavaScript to the response
>
> Is this the recommended approach? I was expected that
> I wouldn't need to pass the callback function name to the servlet and
> could just return the JSON from the servlet instead of a string of
> JavaScript code.
>
> --
> R. Mark Volkmann
> Object Computing, Inc.

Reply via email to