It appears that I can't nest getJSON calls.
When I make the second call, the throbber in Firebug spins forever.
I'm getting a list of changes from a database and then trying to get
more precise data on each change with a second getJSON call in an
anonymous function in the first getJSON call.
Can anyone enlighten me on this?
On Nov 11, 10:07 am, herbasher <[EMAIL PROTECTED]> wrote:
> Pretty, pretty.
>
> What's your problem?
>
> What are you working on?
>
> Herb
>
> On Nov 10, 3:45 pm, Mark Lacas <[EMAIL PROTECTED]> wrote:
>
> > Here is my code:
>
> > $.getJSON("/cgi-bin/messages.cgi", { id: last_message },
> > function( json ) {
>
> > $.each( json.messages, function( i, item ){
>
> > if ( item.command == "new" ) {
> > $.getJSON("/cgi-bin/get_data.cgi", { id: item.id,
> > fields: "all" },
> > function( json ) {
>
> > $.each( json.objects, function( i, item ){
> > create_object( item );
> > //return false;
> > });
> > });
>
> > } else if ( item.command == "change" ){
> > $.getJSON("/cgi-bin/get_data.cgi", { id:
> > item.target, fields:
> > "all" }, function( json ) {
>
> > $.each( json.dp_objects, function( i, item
> > ) {
> > update_object( item );
> > });
> > });
>
> > } else if ( item.command == "delete" ){
> > $(".object[id_num=item.target]").remove();
>
> > }
> > });
>
> > });