Ajax.Updater does support scripts, but only inline (not external JS
files).  It uses Element#update[1] behind the scenes, which in turn
uses String#evalScripts[2]; more in the API pages for those.

FWIW, an alternate approach would be to return the data in JSON format
with flags on new users.  Code already on the page can interpret the
returned data and trigger the sound as necessary.

[1] http://prototypejs.org/api/element/update
[2] http://prototypejs.org/api/string/evalScripts

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

On Mar 24, 1:40 am, JT <cpac...@gmail.com> wrote:
> I have a loop that runs this:
> new Ajax.Updater('usersOnline','users.php', { method:'get',
> asynchronous:true });
> which returns a list of users that are online. If a new user appears
> it will play a sound (ding).
> In the data that is returned (from users.php) I want to include code
> (javascript) to play a sound but it appears that it wont load scripts
> inside the data returned to the div. Any Ideas?
> Thanks in advance.
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 
For more options, visit this group at 

Reply via email to