[jQuery] Re: History / Remote Plugin Instructions

2007-06-30 Thread Klaus Hartl


Benjamin Sterling wrote:

cfloop...
a class=remote href=color-#currentrow#li
class=ProductColor#currentrow#/li/a
/cfloop


Be aware, that the above is not correct XHTML.  you can probably get 
away with:


li href=url class=remote/li



That isn't correct (X)HTML either.

And won't work. The remote/history plugin relies on links pointing to a 
fragment identifier, like #whatever, otherwise there is no way to add 
to history. That could be done of course somehow else, but is not 
currently supported.



--Klaus


[jQuery] Re: Selecting the first TD of every Row

2007-06-30 Thread [EMAIL PROTECTED]

I've tried the method Mehmet but still no success with this goal
(select every first TD on every TR.
Maybe im doing something wrong, but can someone assure if this code is
in fact correct?

Regards!

On Jun 10, 10:40 am, Mehmet AVSAR [EMAIL PROTECTED] wrote:
 $(tr).each(function() {
 $(TD, $(this)).get(0).addClass(tomas)

 });

 On Jun 8, 6:40 pm, Karl Swedberg [EMAIL PROTECTED] wrote:

   $('trtd').addClass(tomas);

  actually, that willselectall td elements that are children of a
  tr element -- in other words, all td elements.

  Try this instead:

  $('td:first-child').addClass('tomas');

  That selects all td elements that are thefirstchild of their
  parent element.

  This works equally well:

  $('td:nth-child(1)').addClass('tomas');

  * Note: :nth-child(n) is the only 1-based jQuery selector, since it
  is solely based on the CSS pseudo-class, which is also 1-based.

  --Karl
  _
  Karl Swedbergwww.englishrules.comwww.learningjquery.com

  On Jun 8, 2007, at 12:28 PM, Alexandre Plennevaux wrote:

   $('trtd').addClass(tomas);

   -Original Message-
   From: jquery-en@googlegroups.com [mailto:jquery-
   [EMAIL PROTECTED] On
   Behalf Of jorgeBadaBing
   Sent: vendredi 8 juin 2007 16:14
   To: jQuery (English)
   Subject: [jQuery] Selecting thefirstTDofeveryRow

   I have been looking online at the documentation and don't seen to
   have any
   luck find a way of doing this.

   So far I can do this:

   $(td:first).addClass(tomas);

   Which applies a class to thefirsttdit founds in the table.

   How can Iselectthefirsttdforeverytr?

   Help will be much appreciated.

   Thanks!

   Ce message Envoi est certifié sans virus connu.
   Analyse effectuée par AVG.
   Version: 7.5.472 / Base de données virus: 269.8.11/838 - Date:
   7/06/2007
   14:21- Hide quoted text -

  - Show quoted text -



[jQuery] Re: Selecting the first TD of every Row

2007-06-30 Thread spinnach


what about:

$('tr').each(function(){
  $('td:first', this).addClass('tomas');
});

dennis.

[EMAIL PROTECTED] wrote:

I've tried the method Mehmet but still no success with this goal
(select every first TD on every TR.
Maybe im doing something wrong, but can someone assure if this code is
in fact correct?

Regards!

On Jun 10, 10:40 am, Mehmet AVSAR [EMAIL PROTECTED] wrote:

$(tr).each(function() {
$(TD, $(this)).get(0).addClass(tomas)

});

On Jun 8, 6:40 pm, Karl Swedberg [EMAIL PROTECTED] wrote:


$('trtd').addClass(tomas);

actually, that willselectall td elements that are children of a
tr element -- in other words, all td elements.
Try this instead:
$('td:first-child').addClass('tomas');
That selects all td elements that are thefirstchild of their
parent element.
This works equally well:
$('td:nth-child(1)').addClass('tomas');
* Note: :nth-child(n) is the only 1-based jQuery selector, since it
is solely based on the CSS pseudo-class, which is also 1-based.
--Karl
_
Karl Swedbergwww.englishrules.comwww.learningjquery.com
On Jun 8, 2007, at 12:28 PM, Alexandre Plennevaux wrote:

$('trtd').addClass(tomas);
-Original Message-
From: jquery-en@googlegroups.com [mailto:jquery-
[EMAIL PROTECTED] On
Behalf Of jorgeBadaBing
Sent: vendredi 8 juin 2007 16:14
To: jQuery (English)
Subject: [jQuery] Selecting thefirstTDofeveryRow
I have been looking online at the documentation and don't seen to
have any
luck find a way of doing this.
So far I can do this:
$(td:first).addClass(tomas);
Which applies a class to thefirsttdit founds in the table.
How can Iselectthefirsttdforeverytr?
Help will be much appreciated.
Thanks!
Ce message Envoi est certifié sans virus connu.
Analyse effectuée par AVG.
Version: 7.5.472 / Base de données virus: 269.8.11/838 - Date:
7/06/2007
14:21- Hide quoted text -

- Show quoted text -







[jQuery] Re: Selecting the first TD of every Row

2007-06-30 Thread John Resig


The solution is what Klaus posted - you just have to use :first-child.

$(td:first-child).addClass(tomas);

--John

On 6/8/07, jorgeBadaBing [EMAIL PROTECTED] wrote:


I have been looking online at the documentation and don't seen to have
any luck find a way of doing this.

So far I can do this:

$(td:first).addClass(tomas);

Which applies a class to the first td it founds in the table.

How can I select the first td for every tr?

Help will be much appreciated.

Thanks!




[jQuery] Re: Selecting the first TD of every Row

2007-06-30 Thread John Resig


Err, I meant Karl - sorry!

On 6/30/07, John Resig [EMAIL PROTECTED] wrote:

The solution is what Klaus posted - you just have to use :first-child.

$(td:first-child).addClass(tomas);

--John

On 6/8/07, jorgeBadaBing [EMAIL PROTECTED] wrote:

 I have been looking online at the documentation and don't seen to have
 any luck find a way of doing this.

 So far I can do this:

 $(td:first).addClass(tomas);

 Which applies a class to the first td it founds in the table.

 How can I select the first td for every tr?

 Help will be much appreciated.

 Thanks!





[jQuery] Re: Odd behavior with events and loaded content

2007-06-30 Thread [EMAIL PROTECTED]

Thanks for the help, I think I solved the issue. I wasn't binding the
loaded elements correctly. For anyone who runs into the same issue,
this is my jQuery code:

$(document).ready(function() {
$(#tabarea).load(ajax/classes.asp?StudentID=
%=rsChildInfo__MMColParam%);
$('body').click(function(event) {
if ($(event.target).is('#ajaxAdd')) {
$(event.target).after('this is cool');
}
});
});

On Jun 29, 3:04 am, Ganeshji Marwaha [EMAIL PROTECTED] wrote:
 is it possible that u r attaching this event handler multiple times to the
 link, probably by calling ur addClass() method somewhere...

 also, can u post a test page somewhere where we can have a look at what is
 going on.

 -GTG

 On 6/28/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:



  I have a page (edit.asp) which uses the .load() to load another page
  into a div. Inside this loaded page (students.asp) is a select box
  (id=classavailable) and a link (id=ajaxAdd).

  I am trying to run an event after the user selects a value in the
  select box and clicks the link. Right now, I just have it set up to
  run an alert:

  This is the jQuery on edit.asp, the main page:

  function addClass() {
  $(#ajaxAdd).click(function(){
 alert($('#classavailable').val());
  });
  }

  After a user selects a value and clicks the link for the first time,
  nothing happens. If the link is clicked again (with no other
  interaction) the function runs. If a user then changes the select
  value and clicks the link, the function runs twice. If a user selects
  a third unique value and clicks the link, the function runs three
  times.

  What I want is the function to run only once and when the link is
  clicked. Can anyone tell me what I have overlooked?

  Thanks!

  - Seth



[jQuery] Re: Selecting the first TD of every Row

2007-06-30 Thread Ganeshji Marwaha

one more solution - $(tr).find(td:eq(0)).addClass(someClass);




On 6/30/07, John Resig [EMAIL PROTECTED] wrote:



Err, I meant Karl - sorry!

On 6/30/07, John Resig [EMAIL PROTECTED] wrote:
 The solution is what Klaus posted - you just have to use :first-child.

 $(td:first-child).addClass(tomas);

 --John

 On 6/8/07, jorgeBadaBing [EMAIL PROTECTED] wrote:
 
  I have been looking online at the documentation and don't seen to have
  any luck find a way of doing this.
 
  So far I can do this:
 
  $(td:first).addClass(tomas);
 
  Which applies a class to the first td it founds in the table.
 
  How can I select the first td for every tr?
 
  Help will be much appreciated.
 
  Thanks!
 
 




[jQuery] Re: Odd behavior with events and loaded content

2007-06-30 Thread Renato Formato


[EMAIL PROTECTED] ha scritto:

I have a page (edit.asp) which uses the .load() to load another page
into a div. Inside this loaded page (students.asp) is a select box
(id=classavailable) and a link (id=ajaxAdd).

I am trying to run an event after the user selects a value in the
select box and clicks the link. Right now, I just have it set up to
run an alert:

This is the jQuery on edit.asp, the main page:

function addClass() {
$(#ajaxAdd).click(function(){
alert($('#classavailable').val());
});
}

After a user selects a value and clicks the link for the first time,
nothing happens. If the link is clicked again (with no other
interaction) the function runs. If a user then changes the select
value and clicks the link, the function runs twice. If a user selects
a third unique value and clicks the link, the function runs three
times.

What I want is the function to run only once and when the link is
clicked. Can anyone tell me what I have overlooked?

Thanks!

- Seth



Maybe you are calling addClass when the user click on your link.
That would explain what you experience.

You should run

$(#ajaxAdd).click(function(){
alert($('#classavailable').val());
 });

just once when you loaded page is complete.

Renato


[jQuery] Building a table from an array

2007-06-30 Thread Phil Glatz

Newbie question - can somebody please provide an example or reference
to some existing code on how to create a table from an array of
javascript data, please?

I have an array of data to populate the table tbody; each element in
the array represents a row, and contains an array of the contents of
each column. There could be additional rows for the theader and
tfooter.

I want a function I can pass a table id and the data array, that would
populate the table. I'd also like ot be able to clear all the rows of
the table, so I could insert different data that may contain fewer
rows.

thanks.



[jQuery] Re: Selecting the first TD of every Row

2007-06-30 Thread Karl Swedberg

Hey John,

No need to apologize to me. I take it as a compliment!  :-)


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Jun 30, 2007, at 1:41 PM, John Resig wrote:



Err, I meant Karl - sorry!

On 6/30/07, John Resig [EMAIL PROTECTED] wrote:
The solution is what Klaus posted - you just have to use :first- 
child.


$(td:first-child).addClass(tomas);

--John

On 6/8/07, jorgeBadaBing [EMAIL PROTECTED] wrote:

 I have been looking online at the documentation and don't seen  
to have

 any luck find a way of doing this.

 So far I can do this:

 $(td:first).addClass(tomas);

 Which applies a class to the first td it founds in the table.

 How can I select the first td for every tr?

 Help will be much appreciated.

 Thanks!







[jQuery] Re: ANNOUNCE: Call for Articles for Visual jQuery Magazine

2007-06-30 Thread Jean


Yeah greate idea, this will teach a lot of users (including me \o/)

On 6/30/07, Rey Bango [EMAIL PROTECTED] wrote:


Hey Ty, I think thats a great idea. Make sure to update us here as I'm
sure Yehuda will be reading this soon.

Rey...

[EMAIL PROTECTED] wrote:
 Hi Rey,
I proposed the idea about a monthly column highlighting say three
 or so sites each month, that are doing a bang up job with jQuery. I've
 contacted a certain noted javascript author who wrote a few articles
 for .NET magazine in the UK. Waiting to see if he'll help me out with
 it. I think his javascripting skills are much better than mine.
 copy/paste/tweaker,
 Ty Gossman

 On Jun 29, 5:09 pm, Rey Bango [EMAIL PROTECTED] wrote:
 I'll let Yehuda answer that.

 Rey



 Glen Lipka wrote:
 What are the timelines?  Target deadlines.
 Glen
 On 6/29/07, *Ganeshji Marwaha* [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:
 can i get a link to the
 last issue, to get an idea of what is the typical style.
 -GTG
 On 6/29/07, *Rey Bango*  [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] wrote:
 Absolutely. Anything jQuery-related.
 Benjamin Sterling wrote:
   Rey,
   I may have missed it in the blog, but can these articles be
 related to
   plugins?  ie jqModal, Form Validator...
   Ben
   On 6/29/07, *Rey Bango*  [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED] mailto: [EMAIL PROTECTED]
 mailto:[EMAIL PROTECTED]
   wrote:
  Back in September of last year, jQuery team member Yehuda Katz
  published
  the first issue Visual jQuery Magazine
  (http://www.visualjquery.com/magazine/
 http://www.visualjquery.com/magazine/). The online magazine
 was a huge
  success with great content and received a very positive
 response from
  the jQuery community.
  Yehuda is now pushing forward with issue #2 and is actively
 soliciting
  contributions from the community. The articles can vary
 from beginner to
  advance topics as well as overall size. If you're interested 
in
  contributing to the jQuery community and getting yourself
 published,
  this is an awesome opportunity to do so.
  For more details please visit the jQuery blog entry here:
 http://jquery.com/blog/2007/06/28/163/
 http://jquery.com/blog/2007/06/28/163/
  Rey...
   --
   Benjamin Sterling
   http://www.KenzoMedia.comhttp://www.KenzoMedia.com
   http://www.KenzoHosting.com
 --
 BrightLight Development, LLC.
 954-775- (o)
 954-600-2726 (c)
 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED]
http://www.iambright.comhttp://www.iambright.com
 --
 BrightLight Development, LLC.
 954-775- (o)
 954-600-2726 (c)
 [EMAIL PROTECTED]://www.iambright.com






--

[]´s Jean
www.suissa.info

  Ethereal Agency
www.etherealagency.com


[jQuery] Binding actions after an ajax call?

2007-06-30 Thread Tobias Parent


Hey -

I've got content being loaded via

$('#myDivID div.itemContent').load('/controller/action/'), and the 
information being loaded is a list of links, which I'd like to set to 
trigger a series of ajax calls for related DIV's throughout the page. 
Can I simply set the callback on the load() to a bind()? Total NOOB, in 
over my head.


glub, blub...
- Toby


[jQuery] Re: Binding actions after an ajax call?

2007-06-30 Thread Tobias Parent


Answering my own question... I tried it out, and this works beautifully, 
so far:


$('#myEventList div.itemContent').load('/events/quicklist', 
function(){
$('#myEventList div.itemContent a.event').bind('click', 
function(){

showEventDetails(this.id);
})
});


... And then showEventDetails() strips out what it needs, and does the 
same load() for each related DIV. Woo-hoo!! jQuery ROCKS! And it makes 
rapid development simple with CakePHP!!


Regards,
-Toby


[jQuery] Re: History / Remote Plugin Instructions

2007-06-30 Thread Benjamin Sterling

Klaus,
I knew it was incorrect xhtml, just trying to point 'em in some direction.

On 6/30/07, Klaus Hartl [EMAIL PROTECTED] wrote:



Benjamin Sterling wrote:
 cfloop...
 a class=remote href=color-#currentrow#li
 class=ProductColor#currentrow#/li/a
 /cfloop


 Be aware, that the above is not correct XHTML.  you can probably get
 away with:

 li href=url class=remote/li


That isn't correct (X)HTML either.

And won't work. The remote/history plugin relies on links pointing to a
fragment identifier, like #whatever, otherwise there is no way to add
to history. That could be done of course somehow else, but is not
currently supported.


--Klaus





--
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com


[jQuery] Re: Binding actions after an ajax call?

2007-06-30 Thread Ⓙⓐⓚⓔ

 $('#myEventList div.itemContent a.event').bind('click',function(){

should be the same as

 $('a.event',this).bind('click',function(){

faster and shorter!

On 6/30/07, Tobias Parent [EMAIL PROTECTED] wrote:



Answering my own question... I tried it out, and this works beautifully,
so far:

 $('#myEventList div.itemContent').load('/events/quicklist',
function(){
 $('#myEventList div.itemContent a.event').bind('click',
function(){
 showEventDetails(this.id);
 })
 });


... And then showEventDetails() strips out what it needs, and does the
same load() for each related DIV. Woo-hoo!! jQuery ROCKS! And it makes
rapid development simple with CakePHP!!

Regards,
-Toby





--
Ⓙⓐⓚⓔ - יעקב   ʝǡǩȩ   ᎫᎪᏦᎬ