[jquery-dev] Re: Proposal: Attributed events

2009-01-31 Thread treshug...@gmail.com
I agree with Flesler. jQuery is designed to abstract things such as this. I actually do have a plugin that allows a syntax easier than this. It's name is Keys and you can find it on the jQuery plugin site or at http://shugartweb.com/jquery/keys. It allows syntax such as $('input').keys('tab, spa

[jquery-dev] Re: Suggestion.

2009-01-31 Thread John Resig
> Make sure you are using jQuery 1.3.1. In 1.3.0 there was an issue where live > wasn't working properly for elements that were not matched in the DOM at run > time. More specifically - it was only for the case of $("#foo") (ID selector - and nothing else). Everything else worked fine. --John -

[jquery-dev] Re: Suggestion.

2009-01-31 Thread Brandon Aaron
Make sure you are using jQuery 1.3.1. In 1.3.0 there was an issue where live wasn't working properly for elements that were not matched in the DOM at run time. -- Brandon Aaron On Sat, Jan 31, 2009 at 12:20 PM, NeoTech wrote: > > I have been having to rewrite functions as append, html, before,

[jquery-dev] Re: 1.3.1 regression in $.fn.filter?

2009-01-31 Thread John Resig
Just to clarify: Attribute selectors still exist. We just no longer do attribute selectors against non-DOM elements (such as text nodes, or comments). Thus the filter that you specified no longer works. You can use a custom filter instead. .filter(function(){ return this.nodeType == 3; }) --John

[jquery-dev] Re: 1.3.1 regression in $.fn.filter?

2009-01-31 Thread Jed Schmidt
Ah, I guess I missed that. I think Yehuda's attributed events post might have given me the impression that the attribute syntax was still around. Thanks much, Jed Schmidt On Jan 31, 9:42 am, John Resig wrote: > Yeah, there was a discussion on this previously - support for that > undocumented f

[jquery-dev] Re: Suggestion.

2009-01-31 Thread John Resig
"I have tried live. but that only works if you have data injected before you start." Can you expand on this, at all? I would've recommended that you try .live(). --John On Sat, Jan 31, 2009 at 10:20 AM, NeoTech wrote: > > I have been having to rewrite functions as append, html, before, and >

[jquery-dev] Re: obj.hide() hangs webkit based browsers in some circumstances

2009-01-31 Thread John Resig
Interesting - that's a good point, though (causing the reflow to constantly occur). Would you be willing to file a bug here? http://dev.jquery.com/newticket --John On Sat, Jan 31, 2009 at 8:38 AM, Boris Ceranic wrote: > Hi all, > while working on a project, I have a following situation. There

[jquery-dev] Suggestion.

2009-01-31 Thread NeoTech
I have been having to rewrite functions as append, html, before, and so on. with a function callback. And my suggestion is that give the html manipulation functions a callback option. why? I have found it easier to bind events this way. Mainly because the browser waits for the dom injection and T

[jquery-dev] obj.hide() hangs webkit based browsers in some circumstances

2009-01-31 Thread Boris Ceranic
Hi all, while working on a project, I have a following situation. There is a page that has about 1000 images on it. Divs which hold images have few classes that I use as filter for showing/hiding only images that belong to specific category. Following piece of code does the actual show/hide job (b

[jquery-dev] Re: live() slowing down DOM access after each firing

2009-01-31 Thread John Resig
] > I have gone through it again and looked at source code. > > I now got the problem you are talking about in your message... > > ...parent[ doneName]... (gasp) > > and I know the related problem there is in that part of selectors to > be able to do that fast enough. > > But really you don't ne

[jquery-dev] Re: live() slowing down DOM access after each firing

2009-01-31 Thread Diego Perini
John, I have gone through it again and looked at source code. I now got the problem you are talking about in your message... ...parent[ doneName]... (gasp) and I know the related problem there is in that part of selectors to be able to do that fast enough. But really you don't need to do th

[jquery-dev] Re: Very slow performance in 1.3.1 when inserting large HTML fragment

2009-01-31 Thread Diego Perini
Dimi Paun, It could be the slowdown is due to the "in-line" RegExp in the trim(). I always keep these pre-compiled in an external variable for speed (cached). Since you are going to try, I would suggest that as the first try. Next try would be also to avoid a call to trim() and just do it in- li

[jquery-dev] Re: 1.3.1 regression in $.fn.filter?

2009-01-31 Thread John Resig
Yeah, there was a discussion on this previously - support for that undocumented feature was removed in 1.3. --John 2009/1/30 Jed Schmidt : > > Hey all, > > Nice meeting you guys at Kilowatt yesterday. > > I seem to have run across a bug in 1.3.1: > > $("abc").contents().is("[nodeType=3]") > >

[jquery-dev] Re: 1.3.1 regression in $.fn.filter?

2009-01-31 Thread Ricardo Tomasi
AFAIK 'properties selectors' like that only work by coincidence, they are not supported. On Jan 30, 11:48 pm, Jed Schmidt wrote: > Hey all, > > Nice meeting you guys at Kilowatt yesterday. > > I seem to have run across a bug in 1.3.1: > > $("abc").contents().is("[nodeType=3]") > > returns true

[jquery-dev] Re: Missing currentTarget in $.event.fix?

2009-01-31 Thread Jörn Zaefferer
Okay, thanks for clarifying, Ariel. Jörn On Sat, Jan 31, 2009 at 1:02 PM, Ariel Flesler wrote: > > No, currentTarget was a 1.3.x addition. I added it within trigger and > thought event objects had it in IE. > I realized I was wrong some days ago. I'll add it once I get back. It > should be done

[jquery-dev] Re: Very slow performance in 1.3.1 when inserting large HTML fragment

2009-01-31 Thread Dimi Paun
Thanks. But we can do better still: 1. it seems that the slow part for trimming is trimming spaces at the *end* which is rather irrelevant here. 2. in fact, we don't need _any_ trimming here, we could just have a reg exp that matches the begging and ignores leading spaces. Of

[jquery-dev] Re: Missing currentTarget in $.event.fix?

2009-01-31 Thread Brandon Aaron
Sorry Ariel, your right. I believe I must have been thinking about relatedTarget. :) -- Brandon Aaron On Sat, Jan 31, 2009 at 6:02 AM, Ariel Flesler wrote: > > No, currentTarget was a 1.3.x addition. I added it within trigger and > thought event objects had it in IE. > I realized I was wrong so

[jquery-dev] Re: Very slow performance in 1.3.1 when inserting large HTML fragment

2009-01-31 Thread gtd...@googlemail.com
On 31 Jan, 08:13, helianthus wrote: > I remembered this article I read quite a long time > ago:http://blog.stevenlevithan.com/archives/faster-trim-javascript And just to save anyone else following the trail as I just did, the shortcut to the conclusion is here: http://dev.jquery.com/ticket/2279

[jquery-dev] Re: Very slow performance in 1.3.1 when inserting large HTML fragment

2009-01-31 Thread gtd...@googlemail.com
See http://dev.jquery.com/ticket/2279 On 31 Jan, 08:13, helianthus wrote: > I remembered this article I read quite a long time > ago:http://blog.stevenlevithan.com/archives/faster-trim-javascript (apologies if post duplicated - google groups is playing up) --~--~-~--~~

[jquery-dev] Re: Very slow performance in 1.3.1 when inserting large HTML fragment

2009-01-31 Thread Ariel Flesler
http://dev.jquery.com/ticket/2279#comment:7 -- Ariel Flesler http://flesler.blogspot.com On 30 ene, 22:02, dimi wrote: > Hi folks, > > I have a large HTML fragment that I load via AJAX. The fragment is big > (~660KB), > and it takes over 2s (more like 2.7s) to insert it. > > I've profiled the c

[jquery-dev] Re: Proposal: Attributed events

2009-01-31 Thread Ariel Flesler
The idea is nice, but I think is quite out of the core's scope. There're already +1 hotkey plugins and they work nicely. This syntax could be proposed to these plugins' owners. -- Ariel Flesler http://flesler.blogspot.com On 30 ene, 03:24, Yehuda Katz wrote: > I brought this up a while back an

[jquery-dev] Re: Missing currentTarget in $.event.fix?

2009-01-31 Thread Ariel Flesler
No, currentTarget was a 1.3.x addition. I added it within trigger and thought event objects had it in IE. I realized I was wrong some days ago. I'll add it once I get back. It should be done within $.event.handle. -- Ariel Flesler http://flesler.blogspot.com On 30 ene, 19:17, Brandon Aaron wrot

[jquery-dev] Re: Very slow performance in 1.3.1 when inserting large HTML fragment

2009-01-31 Thread helianthus
I remembered this article I read quite a long time ago: http://blog.stevenlevithan.com/archives/faster-trim-javascript On 1月31日, 上午5時02分, dimi wrote: > Hi folks, > > I have a large HTML fragment that I load via AJAX. The fragment is big > (~660KB), > and it takes over 2s (more like 2.7s) to inse