[jQuery] Re: getJSON callback? does not work with querystring param

2009-07-06 Thread expresso
Adding a jsoncallback=? or callback=? got rid of the Access to restricted URI denied code: 1012 but I get no data showing in my plug-in when adding either of those querystring params to my url. So I don't get it. I thought that it's supposed to automatically replace ? with function(data) in my

[jQuery] Re: getJSON callback? does not work with querystring param

2009-07-06 Thread mkmanning
For JSONP, the server needs to wrap the response in the supplied callback. The cross-domain getJSON function is basically appending a script to the page, with the contents of that script being a function containing the data you want to pass back. Play around with the URL in the flickr example

[jQuery] Re: getJSON callback? does not work with querystring param

2009-07-06 Thread Bill Ramirez
If you pass a param to the json call, it gets passed into the querystring: $.getJSON(jsdata/customerhandler.ashx, { show: Math.random(), departmentId: dptId}, customerLoaded); would be rendered as: jsdata/customerhandler.ashx?show=0.23231553departmentId=123 the second parameter to the getJson

[jQuery] Re: getJSON callback? does not work with querystring param

2009-07-06 Thread expresso
Thanks. I'm not following you though per my example. I have specified function(data) as the method On Jul 6, 10:56 am, Bill Ramirez betbuil...@gmail.com wrote: If you pass a param to the json call, it gets passed into the querystring: $.getJSON(jsdata/customerhandler.ashx, { show:

[jQuery] Re: getJSON callback? does not work with querystring param

2009-07-06 Thread expresso
Ok, so their sending back a json response wrapped with method foo. So then how would you specify foo in my example as the method to call on the getJSON script I've created? I think my example is fine as it is. We're not going cross server for now but wanted to understand how to form this and

[jQuery] Re: getJSON callback? does not work with querystring param

2009-07-06 Thread Ricardo
When you use callback=? jQuery will create a random name for the anonymous function you pass in. For example: $.getJSON(CarouselHandler.ashx?jsoncallback=?,function(data) { }); The actual requested URL will be CarouselHandler.ashx? jsoncallback=abc12345, and the global variable 'abc12345' will

[jQuery] Re: getJSON callback? does not work with querystring param

2009-07-06 Thread mkmanning
You mentioned Access to restricted URI denied, which is a cross- domain error. Just as an FYI, making a request to a different port number will trigger this. Something to always keep in mind when working with ajax. On Jul 6, 10:09 am, expresso dschin...@gmail.com wrote: Ok, so their sending