Hi hartum, foo is not defined because is not "global"
in the jsfiddle I've changed the "wrapping method".... look: http://jsfiddle.net/5uC5M/7/ now with no wrap is working :) -- Andrea On Fri, Jan 21, 2011 at 09:37, hartum <[email protected]> wrote: > first of all, thank you for your answers > > second, in this moment I feel like stupid, becouse still didn't work > > I set my callbackKey as foo: > callbackKey: 'foo' > > http://jsfiddle.net/5uC5M/6/ > > and my response as: > <?php > echo 'foo({"errors":"0","disponible":0})'; > ?> > > And I get this error: "foo is not defined" > > What I am doing wrong? > > Thanks you again. > > On 21 ene, 08:53, Sanford Whiteman <[email protected]> > wrote: > > The string > > > > ({"errors":"0","disponible":0}) > > > > isn't valid JSONP. > > > > You have to wrap it in a callback function. That's why JSONP works > > even though the browser can't read the results of the script tag as > > plain text. > > > > cbfunc({"errors":"0","disponible":0}) > > > > -- S. >
