T.J. That fixed the issue. It is now properly showing the loading message and then displaying the retrieved data.
Thanks! Brian On Dec 8, 3:43 am, "T.J. Crowder" <[EMAIL PROTECTED]> wrote: > Hi, > > So, both the loading message and the tab content are retrieved via > Ajax.Updater from the server? When you fire off multiple XHR > requests, you have no guarantee of the order in which they'll > complete. Even if the server normally responds to one of them > instantaneously and the other only after a couple of seconds, network > delays or other requests in progress can cause the quick one to > complete _after_ the slow one. That wouldn't cause the behavior you > describe (showing loading, showing the data, then showing loading > again), but would cause the behavior of showing the data, then showing > the loading message. > > (Separately: Ajax.Updater doesn't have the "frequency" option used in > your second call.) > > I would suggest having the loading message handy rather than > retrieving it from the server every time, and updating directly: > > function loadTab(div, tab) { > // Show loading message > $(div).update(loading_msg); > > // Request the tab > new Ajax.Updater(div, tab, { method: 'get' }); > > } > > FWIW, > -- > T.J. Crowder > tj / crowder software / com > > On Dec 8, 4:18 am, theQco <[EMAIL PROTECTED]> wrote: > > > Hi everyone, > > > This is my first real project working with Prototype and I am sure > > that I am doing something silly but any help/advice/feedback would be > > greatly appreciated. > > > Here is what I am trying to accomplish. When a user clicks on a link > > on my website, I would like it to display a notification message > > saying that it is loading the data while it retrieves it from the > > database and then displays it. Pretty standard. The code that I have > > implemented it with works about 95% of the time. > > > The rest of the time, it displays the loading message, then displays > > the data from the database and then immediately shows the loading > > message again and that stays up forever. This is all with one click. > > > My code is as follows: > > > function loadTab (div, tab) { > > new Ajax.Updater( div, '<?= base_url() ?>updater/loading_data', > > { method: 'get' } ); > > > new Ajax.Updater( div, tab, { method: 'get', frequency: 1 } ); > > > } > > > Again any help would be greatly appreciated. Thanks! > > > Brian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Prototype & script.aculo.us" group. To post to this group, send email to prototype-scriptaculous@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/prototype-scriptaculous?hl=en -~----------~----~----~----~------~----~------~--~---