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
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
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
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
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
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
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)
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
"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
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
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
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
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,
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
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
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
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
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
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
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
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
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
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
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("
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
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
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
> 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;
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
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.
> 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
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
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
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
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
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?
--~--~-~--~~~-
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,
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
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
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
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
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
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
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
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
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
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
47 matches
Mail list logo