Thanks for the reply. I changed it so that processData is declared before $(document).ready. Unfortunately, however, the function still does not seem to be called.
getJSON must be doing the right thing, because I can see the data I'm trying to get when I go to the Net panel in Firebug and look in the Response tab. On May 23, 3:08 pm, Donny Kurnia <donnykur...@gmail.com> wrote: > Al wrote: > > Hi, > > > I'm trying to get some data as JSON, and want to show a spinning > > animation while doing so. I have the following jQuery/HTML: > >http://dpaste.com/46873/ > > > The URL I pass togetJSONreturns some data e.g. {'data': '123456789'} > > and seems to be working properly and returning valid JSON. > > > I pass a callback function called processData togetJSON, but this > > does not seem to be getting called (I put an alert in this function > > just to test if it was being called). > > > Any help would be much appreciated! > > I think if you want to separate callback into processData function, you > must declare it at global scope, not inside the click callback function. > Declare it befoce the $(document).ready > > -- > Donny > Kurniahttp://blog.abifathir.comhttp://hantulab.blogspot.comhttp://www.plurk.com/user/donnykurnia