Hey MMason,

           You're correct, element is defined in that scope, i retract
my previous prescription.

           I'd recommend using Ajax.Request to see if you're method is
working.  What I believe could potentially be causing the problem is
the Updater's native code is attempting to update the element after
your onFailure function has already updated it, in which case you
might see some odd behavior, but i am not sure of that.

          I also highly highly recommend downloading firebug for help
with debugging ajax applications, it allows you to monitor all XHR
requests, you can read the XHR's post request variables and its
response, whether it fails or not.

Cheers,
        Matt

On Jul 16, 11:29 pm, MMason <[EMAIL PROTECTED]> wrote:
> I copied just a small block out of a larger function. Here is the
> entire function where 'element' is defined:
>
> updatePod = function(url,headerText,elementID,headerID){
>         var element = $(elementID);
>         var header = $(headerID);
>         // Random identifier for created div layers.
>         var randID = 'elem' + Math.random();
>         // onCreate
>         element.hide();
>         // Insert loading graphic
>         new Insertion.After(elementID,'<div id="' + randID + '"
> style="padding:5px;"><img src="../assets/images/icons/loading.gif"
> width="18" height="18" align="absmiddle"> Loading...</div>');
>         // Change the header
>         header.update(headerText);
>
>         //Update the region
>         new Ajax.Updater(elementID, url, {
>           method: 'get',
>           evalScripts: true,
>           onSuccess: function(transport) {
>                 showElement(elementID);
>                 hideElement(randID);
>           },
>           onFailure: function() {
>                 element.update('<strong>Error Loading Content</strong>');
>           }
>         });
>
> }
>
> Should this work?
>
> Thanks for the quick reply,
> MIke


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to