Hey there,

I've got a wired problem with insert ().

Here is a snippet of my code:

  chkMsg = new Ajax.PeriodicalUpdater ('', '/ajax/chkmgs.php', {
    method: 'get',
    frequency: 2,
    decay: 1.5,
    onSuccess: function test (originalRequest) {

      var reg = /id="newMessage(\d+)/;
      var result;
      var currentmessageids = new Array ();
      var newmessages = Array ();

      while (result = reg.exec($('messages').innerHTML)){
        currentmessageids.push (result[1]);

      newmessages = originalRequest.responseText.split ("---NEW---");

      newmessages.each ( function (value) {
        result = reg.exec (value);
        if (!currentmessageids.in_array (result[1])) {
          $('messages').insert (value);

the first time this runs (onload) everything's fine. But when the
second update happens, the script stops. Firefox prompt 'Script is not
responding' Safari crashes. When I replace the insert with an update
() the same. With an alert () it works.

I have no idea what the problem is. Maybe someone can help me out on
this? I assume it's my fault and already tried to search for a
solution, maybe got the wrong search parameters, didn't find anything

So any help is very welcome...

thanks olly

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