[jquery-dev] Re: jQuery - Development Environments?

2009-03-14 Thread ricardobeat
I'm on Vista/XP, using SmartSVN for the svn, and Notepad++ as my text editor. For testing/development I have two template folders (one strict one transitional) that holds a .htm file with the jQuery script, a script with an empty ready() call and a css file with a CSS reset. I just copy it over, r

[jquery-dev] Re: Iframe and jQuery

2009-03-13 Thread ricardobeat
You won't be able to do that if the iframe's content comes from another domain. What you can do is overlay a DIV or other element on top of the iframe with position:absolute and get the click events from there. Not sure it works in all browsers. cheers, - ricardo On Mar 12, 5:35 pm, ECS wrote:

[jquery-dev] Re: Odd syntax bug when making a new checkbox element

2009-03-13 Thread ricardobeat
As the error says, the type property can't be changed. You should be using the right syntax from the start, $('') etc. cheers, - ricardo On Mar 12, 1:51 pm, Troop4Christ wrote: > So today I was creating a checkbox element in jQuery when I noticed > that I had a typo in my code..  I had declared

[jquery-dev] Re: 1.3.2 and Firebug

2009-03-05 Thread ricardobeat
Right... but it's still an object, not an array, regardless of it's mimics. Doesn't seem right. (btw is right-click/inspect in DOM tab on one of the brackets the only way to inspect the object?) thanks, - ricardo On Mar 5, 12:40 am, John Resig wrote: > It's supposed to be - and this was a chan

[jquery-dev] Re: $( $(el)[x] ) is faster than $(el).eq(x)

2009-03-04 Thread ricardobeat
Mistyped: eq: function( i ) { var el = [ this[ i<0 ? i+this.length : i] ]; if (el[0] === undefined) el.length = 0; return this.pushStack( el, 'eq', i ); }; It doesn't seem possible to pass the undefined object along. Anyone doing that? $(undefined) and $(null) are also unsupported.

[jquery-dev] Re: 4query project, report and more details

2009-03-04 Thread ricardobeat
You can use jQuery(context).find(selector, selector, selector, ...) And how do you differentiate between $4( [context], selector, selector) and $4(selector, selector, selector)? cheers, - ricardo On Mar 3, 4:14 pm, Daniel Friesen wrote: > Yes, a branch is the idea. Though a branch normally imp

[jquery-dev] Re: $( $(el)[x] ) is faster than $(el).eq(x)

2009-03-03 Thread ricardobeat
jQuery([undefined])[0] === jQuery([])[0] eq() always returns a single element, so you'd only need to allow null/ NaN/""/etc to pass through, I guess: eq: function( i ) { var el = [ this[ i<0 ? i+this.length : i] ]; if (el === undefined) el = []; return this.pushStack( el, 'eq', i ) }

[jquery-dev] Re: jQTouch, a new iPhone Javascript library in jQuery

2009-03-03 Thread ricardobeat
20kb is nothing to transfer over a 3G connection (or even EDGE), which is kind of standard if you're doing any serious mobile browsing. cheers, - ricardo On Mar 3, 5:44 am, Mike wrote: > Hi David, > > pretty cool port of iUI - the only issue I see with it is the size of > the jQuery library. Ye

[jquery-dev] Re: $( $(el)[x] ) is faster than $(el).eq(x)

2009-03-02 Thread ricardobeat
Now this is getting dirty - this should do (split for readability): eq: function( i ) { var el = this[ i<0 ? i+this.length : i]; return this.pushStack( el || [], 'eq', i ) } No loss of performance with this one. - ricardo On Mar 2, 6:10 pm, Robert Katić wrote: > I figured out (unfortu

[jquery-dev] Re: $( $(el)[x] ) is faster than $(el).eq(x)

2009-03-02 Thread ricardobeat
solutions relevant at this point? > However, I am sure that John will consider this optimization too if > needed. > > On Mar 1, 8:01 pm, ricardobeat wrote: > > > We can preserve the index without resorting to get (and without > > affecting performance) by u

[jquery-dev] Re: $( $(el)[x] ) is faster than $(el).eq(x)

2009-03-01 Thread ricardobeat
Robert Katić wrote: > > > If this solution seems ok, I would update the > > tickethttp://dev.jquery.com/ticket/4188. > > > On Feb 28, 8:50 pm, ricardobeat wrote: > > > > Nice catch, that makes sense. Added it to the test page, it has no > > > signif

[jquery-dev] Re: $( $(el)[x] ) is faster than $(el).eq(x)

2009-02-28 Thread ricardobeat
e: > > eq: function( i ) { >     if ( i < 0 ) >         i += this.length; >     return this.pushStack( this[i], 'eq', i ) > > } > > However this solution would be still faster then the one > onhttp://dev.jquery.com/ticket/4188, I suppose. > > On

[jquery-dev] Re: jQuery.cache[ id ][ name ] and Firebug - (Break on All Errors)

2009-02-27 Thread ricardobeat
I think returning undefined is the intention here, same when you do a lookup for a property that doesn't exist, returning null is not equivalent. Referencing undefined properties is not a problem in JS, this "error" is silly not taking the context in consideration. - ricardo On Feb 26, 2:30 pm,

[jquery-dev] Re: $( $(el)[x] ) is faster than $(el).eq(x)

2009-02-26 Thread ricardobeat
Right, thanks! Using pushStack seems ok, it's still chainable and keeps the selector state, while still being at least twice faster. http://dev.jquery.com/ticket/4262 http://jquery.nodnod.net/cases/177/run cheers, - ricardo On Feb 26, 11:28 am, John Resig wrote: > Well, first I would argue th

[jquery-dev] Re: Aliasing of array methods in jQuery

2009-02-25 Thread ricardobeat
y just a convenience plugin, > > wrapping Array.sort and performing the DOM rearrangements afterwards. > > My brief and cursory search of jQuery plugins turned up nothing of the > > sorts (heh), so I just wrote my own simple plugin. > > > -- > > Frode > > &g

[jquery-dev] Re: Aliasing of array methods in jQuery

2009-02-25 Thread ricardobeat
Just to put my finger on the cake, is there any special reason you're using a custom plugin instead of the available sort() method? On Feb 24, 8:27 pm, prefect wrote: > To the defence of jQuery here, I don't think that would work. As I > understand, the purpose of aliasing those methods is to ma

[jquery-dev] Re: How can I scan the whole page of the website then put the correct data to each variables?

2009-02-23 Thread ricardobeat
Use an array, you can also simplify your function a lot by using jQuery (although it will certainly add overhead): var items = []; $('.-list-tem:contains(Item Name)').each(function(){ items.push(this); }); On Feb 22, 8:38 am, rhhhmon wrote: > Hey guys, > > So here's my problem. I want to sc

[jquery-dev] Re: "inDOM" method proposal

2008-12-07 Thread ricardobeat
>> On Wed, Dec 3, 2008 at 4:27 PM, Ariel Flesler <[EMAIL PROTECTED]> wrote: > > >>> That's what I was sort of suggesting, el.ownerDocument.documentElement, > >>> that is. > > >>> As someone said (don't recall and don't wanna

[jquery-dev] Re: Feature request: execute code before .fadeIn()

2008-12-05 Thread ricardobeat
You could simply stop(true,true) the popup animation whenever you hover a different element, then reposition it and call fadeIn(). With your suggested addition there would be a noticeable delay between the fadeOut at the old position, then the start of fadeIn at the new position, making your page

[jquery-dev] Re: "inDOM" method proposal

2008-12-03 Thread ricardobeat
Why not simplify? $.fn.inDOM = function(){ var el=this[0]; if (!el) return false; var doc = el.ownerDocument.documentElement; return (doc.contains) ? doc.contains(el) : !!(doc.compareDocumentPosition(el) & 16); }; 36ms vs 12ms for Diogo's 'inDOM3Optimized', but ke

[jquery-dev] Re: "inDOM" method proposal

2008-11-30 Thread ricardobeat
n. $.fn.inDOM = function(){ var el = this[0]; while (el.parentNode) el = el.parentNode; return el == this[0].ownerDocument; }; - ricardo On 30 nov, 19:43, "Ariel Flesler" <[EMAIL PROTECTED]> wrote: > Yeah, parentNode is not good enough. > > > > On Sun, Nov 30

[jquery-dev] Re: better example for selfOrParents

2008-11-30 Thread ricardobeat
What would be the expected result for your second example? On 27 nov, 20:25, Mark Gibson <[EMAIL PROTECTED]> wrote: > I submitted ticket #3657 for a new method: selfOrParents() > The ticket has since been closed so I'm posting here. > > In the ticket I gave the example of > > selfOrParents(':hidd

[jquery-dev] Re: jQuery selection methods compared to XPath axes.

2008-11-30 Thread ricardobeat
ancestor-or-self: $(...).parents().andSelf() descendant-or-self: $(...).find('*').andSelf(); These return the exact same collection as it's XPath counterparts. I'm not familiar with XPath, I'm intrigued by the uses for 'preceding' and 'following', do you have an example case? It doesn't make muc

[jquery-dev] Re: "inDOM" method proposal

2008-11-30 Thread ricardobeat
Hi, It seems the ownerDocument is set for the created element even if it's not in the DOM, it's the document where jQuery was loaded in. A simple check for parentNode or offsetParent would do: $.fn.inDOM = function(){ return !!this.parentNode; //boolean }); parentNode returns faster for el

[jquery-dev] Re: Iterator Pattern in jQuery

2008-11-13 Thread ricardobeat
It's all kind of already in the core: rewind: $('...').parent().children(':first') next() key: $.fn.key = function(){ return this.parent().children().index(this); }; current: $('...').val() valid : $('...').next().length previous() I probably misunderstood you, what's your objective? - rica

[jquery-dev] Re: jQuery's Data functions

2008-11-04 Thread ricardobeat
Those bracket and dots selectors are very confusing, why not something simple like $('div:data(foo)') and $('div:data(foo!=dido)') ? Meanwhile, you can use a simple plugin (WTFPL licensed): $.fn.hasData = function(){ var a = arguments; return this.filter( (a[1]) ? function(){ ret

[jquery-dev] Re: Ultra-Chaining with jQuery

2008-10-22 Thread ricardobeat
That's exactly what I said the day before, you pratically read my mind :] http://ejohn.org/blog/ultra-chaining-with-jquery/#comment-321336 What about making all methods 'wait' by default? That's what most people expect anyway, people new to jQuery only find out the animations run "in parallel" wh

[jquery-dev] Re: how to get a asynchronous return value from a ajax callback

2008-10-22 Thread ricardobeat
This question should be asked at http://groups.google.com/group/jquery-en I suppose. I assume you're doing something like: function(){ //do something if ( test() ) // do something else } Just split it in two, and get the second part to be the ajax callback: function doSomething(){ //b