There we go, that sounds scientific :-)

btw, Thomas, have you anything to say (maybe in a new thread), regarding what we've been so hotly debating here these last few days? ie. future of proto?

On 7/21/06, Thomas Fuchs <[EMAIL PROTECTED]> wrote:
AFAIK the setTimeout makes sure that the eval() is executed in the window-global context, 
and not the local execution context of the method it happens to be in.

-Thomas

Am 21.07.2006 um 16:19 schrieb Ryan Gahl:

scripts inserted via innerHTML are not executed, so this ensures any scripts actually get executed... does anyone else have the scientific answer for the timeOut? prevent UI blocking as much as possible? There are potential benefits, but it's probably not 100% necessary.

On 7/21/06, Peter Michaux < [EMAIL PROTECTED]> wrote:
Hi,

I have been spending a lot of time reading Prototype.js. Because there
are no comments, I don't understand the rational for why it is doing a
few things. Two things are in Element.update

  update: function(element, html) {
    $(element).innerHTML = html.stripScripts();
    setTimeout(function() {html.evalScripts()}, 10);
  },


Why strip the scripts before inserting? Is this only for NS6 browser support?

Why wait 10 ms before evaluating the scripts?

Thanks,
Peter
_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

_______________________________________________
Rails-spinoffs mailing list

--
Thomas Fuchs
wollzelle


questentier on AIM
madrobby on irc.freenode.net
 
http://www.fluxiom.com :: online digital asset management
http://script.aculo.us :: Web 2.0 _javascript_
http://mir.aculo.us :: Where no web developer has gone before





_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs



_______________________________________________
Rails-spinoffs mailing list
Rails-spinoffs@lists.rubyonrails.org
http://lists.rubyonrails.org/mailman/listinfo/rails-spinoffs

Reply via email to