Hi,

Ajax.Updater doesn't load external script files referenced by the new
content at all, which sort of answers your order-of-events
question. ;-)  This is documented, but only if you go digging:
Ajax.Updater says it updates the target element via Element#update[1],
which in turn says it will use String#evalScripts[2] to process any
script tags; the doc for String#evalScripts says "Only script tags
containing inline code are supported; script tags referencing external
files are ignored (and leave an undefined in the results array)."

onComplete (and more specifically, onSuccess) happens after the update
and so after the inline scripts have been eval'd.  I don't know what
you mean by a "spiralling code base," but because inline scripts are
eval'd as part of the update, if you prefer to have your post-load
processing done there, you can.

[1] http://prototypejs.org/api/ajax/updater
[2] http://prototypejs.org/api/string/evalScripts

HTH,
--
T.J. Crowder
tj / crowder software / com
Independent Software Engineer, consulting services available


On Mar 11, 11:02 am, James <[email protected]> wrote:
> so normally you can use
> Event.observe(window, 'load'
> to fire some js after loading, secure in the knowledge that all
> external js files have been loaded and all elements have been set up.
>
> Whats the equivalent for firing an event after an
> new Ajax.Updater('modal-ajaxdiv', url, { evalScripts:true });
> from inside the returned content?
>
> yes, I've seen onComplete callback, but
>
> a) is that fired after external js files are loaded, etc?
> b) for the sake of not having a spralling code base, i'd prefer to
> fire it from inside the returned content.
>
> thanks in advance,
> James
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to