You're welcome Piotr,

By demo I mean demonstration.  Since you're showing the world what to
do with your code/program, the demonstration could use more
explanation as well.  If I understood better what you're trying to
accomplish, I could be more helpful.  Here's what I see are the main
areas to improve:

1. Don't use .filter().  I looked at the jQuery source, and .filter()
invokes many RegExs, which is definitely slowing the code down.  Also,
you could target your DOM elements more specifically, as in my earlier
examples.

2. Run your code through JSLint by the talented Douglas Crockford:
http://www.jslint.com
  There are serious line-break issues in your code, which JSLint will
point out, and it prevents me from analyzing your code for other
mistyped characters.

Also, check out http://docs.jquery.com/Events .  Binding click,
keypress, and other events is built-in to the jQuery code, so instead
of:
$(element).bind("click", this, fn(e));

Just write:
$(element).click( fn(e) );

Sorry about the plugin/closure thing, I misunderstood what you're
trying to do.  I'm curious to see where you go from here,

Charles

On Sep 7, 8:38 pm, "Piotr Petrus" <[EMAIL PROTECTED]> wrote:
> Hi Charles,
>
> Thanks for taking your time to investigate my issue
>
> However, the site you see is not a demo, it's "fully" functional
> calculator for css dimensions. :) When you start typing, you fire
> different events, and - yes - they affect whole tree & that's
> intentional.
>
> But the thing that only bugs me is adding new nodes. I'll try
> optimizing filters more aggresively, but unfortunately I did similar
> thing before and it didn't make a difference.
>
> About other things that you've said: I don't get the JSLint comment;
> and my code don't need to be wrapped in closure because it's not a
> plugin and it won't be used anywhere else. :)
>
> --
> Piotr Petrushttp://riddle.pl

Reply via email to