[jQuery] 'this' keyword in a custom object

2009-09-22 Thread Alex Wibowo
Hi... I'm trying to write object-oriented style javascript as follows: - function HtmlFormUtil(formId){ this.formId=formId; this.dirtyInputs=new Array(); } HtmlFormUtil.prototype.trackForChanges=function(){ $(":input","#"+this.formId).change(function(){

[jQuery] tbody:first-child & thead

2009-02-25 Thread Alex Wibowo
Hi all, I have a code that counts the number of rows in a table... the table looks like: ... and my jquery looks like: $("#myTable tbody:first-child tr").length; strange enough that always returns 0. but if i remove the thead from the

[jQuery] Re: tbody:first-child & thead

2009-02-25 Thread Alex Wibowo
tbody) > > Cheers, > David > > > > Alex Wibowo wrote: > >> Hi all, >> >> I have a code that counts the number of rows in a table... >> >> the table looks like: >> >> >> >> ... >> >> >> >>

[jQuery] Re: tbody:first-child & thead

2009-02-25 Thread Alex Wibowo
sorry i should say "how does that explain the behaviour when there's no thead" (because it works when thead doesnt exist) On Wed, Feb 25, 2009 at 8:06 PM, Alex Wibowo wrote: > how does that explain the behaviour when there's thead then?? > > > > On

[jQuery] Re: tbody:first-child & thead

2009-02-25 Thread Alex Wibowo
to say is: > > $("#myTable tbody tr:first-child") > > Which is "select the tr that is the first child of tbody" > > http://docs.jquery.com/Selectors/firstChild > > Karl Rudd > > On Wed, Feb 25, 2009 at 8:08 PM, Alex Wibowo wrote: > > sorry

[jQuery] Re: tbody:first-child & thead

2009-02-25 Thread Alex Wibowo
parent E. See specs > at: http://www.w3.org/TR/CSS2/selector.html#first-child > > 2-) If you have a thead or/and a tbody in your markup, to select the first > thead use the pseudo-class :eq instead. > > $("#myTable tbody:eq(0) tr").length ) > > MaurĂ­cio > >

[jQuery] Re: tbody:first-child & thead

2009-02-25 Thread Alex Wibowo
number of rows in the first > tbody > > cheers, > - ricardo > > On Feb 25, 5:25 am, Alex Wibowo wrote: > > Hi all, > > I have a code that counts the number of rows in a table... > > > > the table looks like: > > > > > > > >... > &g

[jQuery] Array function

2009-04-06 Thread Alex Wibowo
Gday, Is there a short way to do: $("#idOne").show(); $("#idTwo").show(); ? So far, my best bet is to do: $.each(["#idOne","#idTwo"],function(){ $(""+this).show(); }); Thanks in advance! -- Best regards, WiB