I've got a ajax request that I'm trying to modify so that it will work
cross domain.  I'm calling this from another domain (localhost to be
precise).

 $.post("http://www.energyjustice.net/map/server-test/webservice/
searchserver-new.php?"+str,
                        { giAjax: "1", gsSearchtype: "nationalmap" },

function (data)
{
   //it does stuff with the data
}
);

Now I know that I should be using $.getJSON, but I haven't been able
to get it to work.


I'm guessing I need to do something like:
 $.getJSON("http://www.energyjustice.net/map/server-test/webservice/
searchserver-new.php?"+str+"jsoncallback=?",
                        { giAjax: "1", gsSearchtype: "nationalmap" },

function (data)
{
   //it does stuff with the data
}
);

I'm confused about whether I should use "jsoncallback=?" or
"jsoncallback=function_name"?

Also, do I need to add something to my server-side php code (like the
name of the callback function)?  It currently just sends back an array
of JSON data.

Thanks!

Reply via email to