[jquery-dev] Firefox animation stutter

2009-08-14 Thread Joe
Is there anything that can be done about poor performance with some animations in Firefox? I know it varies by machine, but with a core 2 duo and 2 gigs of ram running FF 3.5, I'm getting some pretty ugly stutters in a simple carousel that I wrote this morning for my portfolio site. If you're run

[jquery-dev] Re: making .closest() faster on common selectors to improve performance of event delegation.

2009-08-14 Thread lrbabe
Thank for your quick answer John, All right, I take the code of the example, remove the part that updates the counter and wraps the rest with a console.profile() 1. With the orginal .closest() implementation: - entering the ul: function calls = 76, time = 1.5 to 2.5 ms - moving from a li to a li

[jquery-dev] Re: making .closest() faster on common selectors to improve performance of event delegation.

2009-08-14 Thread John Resig
An interesting proposition - although before making a change of this magnitude it would be good to get some performance numbers outlined so that we know how worthwhile it is. --John On Fri, Aug 14, 2009 at 8:33 PM, lrbabe wrote: > > Hi, > > The principle of .closest( selector ) is that it cycl

[jquery-dev] making .closest() faster on common selectors to improve performance of event delegation.

2009-08-14 Thread lrbabe
Hi, The principle of .closest( selector ) is that it cycles through the ancestors of an event target until it finds an element corresponding to the event target, or hits the root. To check for an element matching the selectors it uses the .is ( selector ) function which collects all elements corr

[jquery-dev] Re: about iterators, closures and scope

2009-08-14 Thread Andrea Giammarchi
So let me summarize, we create closures for whatever silly purpose but 3 scopes resolutions are a performances problem? Well, I guess we have to re-think 90% of JavaScript stuff here, isn't it? That "with" was just an example, an elegant one, imho, able to show how things work there and how natura

[jquery-dev] Re: about iterators, closures and scope

2009-08-14 Thread Daniel Friesen
I won't argue that with is a misunderstood feature of JS. I liked it myself. However I'm not a fan of your example. I like with() {} because of the ability to import namespaces into a scope. with(mylibrarysnamespace) { mylibraryfunction(); // called without needing to do mylibrarynamespace.m

[jquery-dev] Re: about iterators, closures and scope

2009-08-14 Thread Andrea Giammarchi
For philosophy agnostics, if a function has not been called via new, and a function by default has an undefined scope unless specified somehow, the usage of this inside this kind of function should throw an massive ERROR! ES5 is already misunderstood 'cause if you return a Object.create(whatever)

[jquery-dev] Re: about iterators, closures and scope

2009-08-14 Thread Andrea Giammarchi
The day undefined will mean "this" in whatever programming language, our existence will reach the most meaningless meaning. Regards On Fri, Aug 14, 2009 at 11:49 PM, Daniel Friesen wrote: > > Whether you think the global object being `this` is an error or not, it > doesn't change the fact these

[jquery-dev] Re: about iterators, closures and scope

2009-08-14 Thread Andrea Giammarchi
"with" is another misunderstood feature of JS, imho, you have to be truly a junior to make mistakes with that (and we all did common mistakes when we were junior, is there anybody that blamed the language rather than hisself?) The only problem I can spot with "with" is not about developers but the

[jquery-dev] Re: about iterators, closures and scope

2009-08-14 Thread Daniel Friesen
Whether you think the global object being `this` is an error or not, it doesn't change the fact these implied references to the global scope create hard to track down bugs just my forgetting a single keyword some random place in the code. `this` makes perfect sense as undefined. You're creatin

[jquery-dev] Re: about iterators, closures and scope

2009-08-14 Thread Daniel Friesen
Ya sorry. Shame it's going away, I wanted to use it for my module inclusion pattern server-side. with( banana('io') ) with( banana('markup.visual.markdown') ) { var html = MarkDown.parse(File('./foo.txt').content) } ~Daniel Friesen (Dantman, Nadir-Seen-Fire) [http://daniel.friesen.name] Hen

[jquery-dev] Re: Building a cut-down version of jQuery

2009-08-14 Thread Leonid Khachaturov
Hi, Are you familiar with http://code.google.com/apis/ajaxlibs/ ? It's Google's distribution network for many of the popular frameworks, jQuery included. It's fast, it serves files gzipped, and it provides proper headers. The idea is, if you use it to serve jQuery to your users, there's a good ch

[jquery-dev] Re: QUnit

2009-08-14 Thread Jörn Zaefferer
As commented on the ticket, this sole issue was an outdated version of QUnit. Not your fault, as the links in the documentation pointed to an expired mirror. I've updated them, the latest version is currently here: http://jqueryjs.googlecode.com/svn/trunk/qunit/testrunner.js Jörn On Thu, Jul 23,

[jquery-dev] Re: eq(-1) - negative numbers take from end of collection

2009-08-14 Thread James Padolsey
Added http://dev.jquery.com/ticket/5050 Thanks guys! On 14 Aug, 13:19, John Resig wrote: > I don't see why not - we already support .get(-1), .eq(-1) makes sense. Want > to file a feature ticket for it? > > --John > > On Fri, Aug 14, 2009 at 2:34 AM, James Padolsey < > > jamespadol...@googlemai

[jquery-dev] Re: width not correct before positioning

2009-08-14 Thread Tom
It did and does not to me, especially the logic behind "thus its width". It may be positioned (x,y) relative to its parent, but why should it be bigger than its content? Something may be placed next to it. Tom John Resig wrote: > This makes sense, right? I mean the element is positioned rela

[jquery-dev] Re: width not correct before positioning

2009-08-14 Thread John Resig
This makes sense, right? I mean the element is positioned relatively (to begin with) thus its width consumes its parent container (which is the body, in this case). Not until you position it absolutely does the width 'shrink' back down. --John On Fri, Aug 14, 2009 at 9:36 AM, tbee wrote: > > I

[jquery-dev] Re: .attr("checked", "checked") not working in IE7

2009-08-14 Thread John Resig
Do you have a full example? .attr("checked", "checked") should work. --John On Thu, Aug 13, 2009 at 5:00 PM, TheMit wrote: > > in IE7: > > $('#rb').attr("checked", "checked") > > does not check a radiobutton, and > > $('#rb').removeAttr("checked") > > does not uncheck a radiobutton. > > Th

[jquery-dev] Re: Building a cut-down version of jQuery

2009-08-14 Thread John Resig
What lines are you commenting out of the make file? I know a few of us have done custom builds before, and it's worked, so there may be another issue at play here. --John On Fri, Aug 14, 2009 at 1:30 AM, braksa...@gmail.com wrote: > > I have written a small amount of jQuery for a client and the

[jquery-dev] Re: Live and Die support for submit in Internet Explorer

2009-08-14 Thread Karl Swedberg
That's correct. live() and die() currently support only a subset of event types: from http://docs.jquery.com/Events/live#typefn: > Possible event values: click, dblclick, mousedown, mouseup, > mousemove, mouseover, mouseout, keydown, keypress, keyup > Currently not supported: blur, focus, mou

[jquery-dev] Re: eq(-1) - negative numbers take from end of collection

2009-08-14 Thread Karl Swedberg
On Aug 14, 2009, at 8:19 AM, John Resig wrote: > I don't see why not - we already support .get(-1), .eq(-1) makes > sense. Want to file a feature ticket for it? > > --John And we already support .slice(-1) :-) --Karl > On Fri, Aug 14, 2009 at 2:34 AM, James Padolsey > wrote: > > Would this

[jquery-dev] Building a cut-down version of jQuery

2009-08-14 Thread braksa...@gmail.com
I have written a small amount of jQuery for a client and they are unhappy with the fact that jQuery contains code that isn't used on the website, so they've told me to remove everything from jQuery except for what I'm using (which is a selector with .find(), .hover(), and .animate() ) I have chec

[jquery-dev] Help

2009-08-14 Thread Dizz845
I'm a newbie to this so please be gentle. When browse my site on firefox on windows the jquery slideUp and slideDown effects cause a wierd trail and mess up the look of the site. any ideas on why or how to fix this? --~--~-~--~~~---~--~~ You received this message b

[jquery-dev] Re: Change :odd and :even to behave like :nth-child(odd) and :nth-child(even)

2009-08-14 Thread paul.shaver
I agree with John as well. There's a subtle distinction between odd/ even collections and odd/even children. Though it's a good argument. On Aug 13, 7:56 am, John Resig wrote: > :odd/:even aren't the same as using :nth-child() - you can't just substitute > one for the other. :odd/:even operate

[jquery-dev] .attr("checked", "checked") not working in IE7

2009-08-14 Thread TheMit
in IE7: $('#rb').attr("checked", "checked") does not check a radiobutton, and $('#rb').removeAttr("checked") does not uncheck a radiobutton. These code samples work fine in all the other browsers I've tried, including IE8 and IE8 in IE7 compatibility mode. I also tried using $('#rb').attr("

[jquery-dev] width not correct before positioning

2009-08-14 Thread tbee
If I try to determine the width of a paragraph, the value is equal to the body. Only after I have positioned it, the value becomes correct. A simple example is below: http://jquery.com/src/jquery-latest.js";> var $jq = jQuery.noConflict(); $jq(docu

[jquery-dev] Live and Die support for submit in Internet Explorer

2009-08-14 Thread CourtlandAllen
While I haven't done extensive testing to ensure this is the case, it seems that .live('submit') and .die('submit') aren't working for forms in Internet Explorer 8. Can anybody else verify that this is the case? --~--~-~--~~~---~--~~ You received this message becau

[jquery-dev] Re: Two questions about jQuery's inside

2009-08-14 Thread lrbabe
Thank you for those quick answers John! I'll file the ticket. On Aug 14, 2:23 pm, John Resig wrote: > > 1. The function hasClass is written this way: > > hasClass: function( selector ) { > >        return !!selector && this.is( "." + selector ); > > }, > > > Why not simply testing the className

[jquery-dev] Re: Two questions about jQuery's inside

2009-08-14 Thread John Resig
> 1. The function hasClass is written this way: > hasClass: function( selector ) { >return !!selector && this.is( "." + selector ); > }, > > Why not simply testing the className against the selector: > return !!selector && (" " + this.className + " ").indexOf(" " + > selector + " ") != -1;

[jquery-dev] Re: prototypal inheritance as part of jQuery core?

2009-08-14 Thread Robert Katić
Test http://pastebin.com/m5279ff23 jquery.ns.js http://pastebin.com/m36dd0f2 Testing it on other browsers http://browsershots.org/http://bender.fesb.hr/~robert/scripts/test-jquery.ns.js.html --~--~-~--~~~---~--~~ You received this message because you are subscribed

[jquery-dev] Two questions about jQuery's inside

2009-08-14 Thread lrbabe
Hello everybody, I'm pretty confident with using jQuery but now I'd like to improve my understanding of the librarie's code itself. I sometime see an alternative way of writing portions of code but I'm pretty sure there is a good reason that it is the way it is... I would just like to understand.

[jquery-dev] Re: The Context property/parameter

2009-08-14 Thread John Resig
> That can't be true, right? It doesn't "search the whole doc". Correct, it only searches the limited sub-set. > The "context" property may be "document" but ".myClass" is only > searched for within "#myContainer", right? (this is how I see it, > after looking at the source) > > I think the mai

[jquery-dev] Re: about iterators, closures and scope

2009-08-14 Thread Henry
On Aug 14, 12:48 pm, Daniel Friesenwrote: > ... , while a nice feature but widely misunderstood while() {} > prevents some potential optimizations so it's a > syntax error in strict mode, ... . Presumably your intended target there was - with( x ){ ... } -, not 'while', as the former is as you d

[jquery-dev] Re: eq(-1) - negative numbers take from end of collection

2009-08-14 Thread John Resig
I don't see why not - we already support .get(-1), .eq(-1) makes sense. Want to file a feature ticket for it? --John On Fri, Aug 14, 2009 at 2:34 AM, James Padolsey < jamespadol...@googlemail.com> wrote: > > Would this be a possibility? > > It would be nice if it worked like JavaScript's Array

[jquery-dev] Re: about iterators, closures and scope

2009-08-14 Thread Andrea Giammarchi
Daniel, I do not think the global object as default this is an error at all, this is my point. What does not make sense at all is to use a "this" referred to an undefined value. undefined is not an object so "this" which is a self-instance/scope pointer does not make sense. This is the most secu

[jquery-dev] Re: about iterators, closures and scope

2009-08-14 Thread Daniel Friesen
Strict mode doesn't have new "features", it has restrictions. Strict mode adds nothing over what ES3 already has, it only places restrictions on things which can cause issues or hinder the ability for the engine to optimize. this in functions is undefined instead of global, eval cannot dynamica

[jquery-dev] Re: about iterators, closures and scope

2009-08-14 Thread Andrea Giammarchi
Who talked about users here? You put "strict" you do not have that common behavior, whatever right or wrong it is, but you cannot use new features for compatibility reason. Where exactly do you find a better development and debug pattern with this strategy? --~--~-~--~~~-

[jquery-dev] Re: about iterators, closures and scope

2009-08-14 Thread Daniel Friesen
Andrea Giammarchi wrote: > Daniel it is a non-sense and I tell you why. > > "strict" aim is to guarantee future compatibility, right? > The choice of "strict" means "hey cool and updated browser, you should > behave like that here!" > > So whatever happens there, under strict, it does not matter,

[jquery-dev] The Context property/parameter

2009-08-14 Thread James Padolsey
Back in June, Brandon wrote an enlightening article about the misunderstood "context" parameter. Read it here: http://brandonaaron.net/blog/2009/06/24/understanding-the-context-in-jquery Most of it makes sense to me now but I'm still a little confused about some of the assertions made as a resu

[jquery-dev] Re: about iterators, closures and scope

2009-08-14 Thread Andrea Giammarchi
Daniel it is a non-sense and I tell you why. "strict" aim is to guarantee future compatibility, right? The choice of "strict" means "hey cool and updated browser, you should behave like that here!" So whatever happens there, under strict, it does not matter, 'cause every other browser will simply

[jquery-dev] Re: about iterators, closures and scope

2009-08-14 Thread Daniel Friesen
new Person() ES3 style: create object, set prototype, run user code Person() ES3 style with !instanceof chunk: run user code, check for instanceof (walk the proto chain), create object, set prototype, run user code ((To be technical; new Person() ES3 style with the !instanceof chunk)): create ob

[jquery-dev] Re: about iterators, closures and scope

2009-08-14 Thread Andrea Giammarchi
Dude, I know what you mean and I use Objeect.create already via vice-versa and no flags configuration but imho to better understand benefits we should consider better examples. I forgot in this one there is another thing to: call the init method over created instance. So, again, our good old ES3 is

[jquery-dev] Re: about iterators, closures and scope

2009-08-14 Thread Pauan
The example chosen was poor. It is true that the example could be trivially implemented right now. Object.create is most useful when either A) using inheritance without functions, or B) when changing the enumerable, writable, and configurable properties. In that case the extra code would be neede

[jquery-dev] Re: ajax() with method "PUT" - missing payload

2009-08-14 Thread Andrea Giammarchi
I was going to write the same ... so I guess the pointless war is over, right? I think I already wrote the simple and robust RegExp ... xhr.send( */^P(U|OS)T$/i*.test( type ) ? s.data : null ); but you can do whatever you want :P Regards On Fri, Aug 14, 2009 at 9:27 AM, James Padolsey < jamesp

[jquery-dev] Re: about iterators, closures and scope

2009-08-14 Thread Andrea Giammarchi
We are not under a unified VM (syntax not usable) and I cannot spot a single benefit using two calls rather than one plus implicit init method. // right now function Man(name){ // here Man prototype has been already inherited // and it is usable from "this" // a constructor is an impli

[jquery-dev] Re: Is jquery still not handling namespaces?

2009-08-14 Thread DBJDBJ
Ok, I realised now you want/need "only" namespaced attributes. I think in this case you are hitting head-on browser differences. Multiplied with the number of ways and influences namespaces in each one of them and Sizzle in turn. Have you tried : and/or $("html").prepend("") ; But all of

[jquery-dev] Re: ajax() with method "PUT" - missing payload

2009-08-14 Thread James Padolsey
I think you mean /^(PUT|POST)$/ Your regex will match PUT at the start of a string or POST at the end of one. On 14 Aug, 09:16, George wrote: > FWIW would it be clearer to write the regex like this? It's the same > number of characters: > >   xhr.send( /^PUT|POST$/i.test( type ) ? s.data : null

[jquery-dev] Re: ajax() with method "PUT" - missing payload

2009-08-14 Thread George
FWIW would it be clearer to write the regex like this? It's the same number of characters: xhr.send( /^PUT|POST$/i.test( type ) ? s.data : null ); George On Aug 13, 5:16 pm, Andrea Giammarchi wrote: > Well, so this is it: > > xhr.send( /^P(U|OS)T$/i.test( type ) ? s.data : null ); > > regar