Pretty sure its because the event is bubbling up. Try: $('#cardcharges td').click(function(){ alert('execute once'); return false; });
On Jul 29, 2:38 pm, marksimon <zen...@gmail.com> wrote: > no stupid ideas here, but changing to $(#cardcharges td).click( didn't > fix the problem. > > On Jul 29, 11:22 am, András Csányi <sayusi.a...@gmail.com> wrote: > > > > > 2009/7/29 marksimon <zen...@gmail.com>: > > > > Any idea why this would run twice: > > > function clickcharges() { > > > $('#cardcharges tr td').click(function() { > > > alert('execute once'); > > > > }); > > > } > > > Stupid idea, but maybe... Because the td tag is part of the tr. And if > > you click the cell once means that one click on the cell and one click > > on the row... :) > > > -- > > - - > > -- Csanyi Andras --http://sayusi.hu--Sayusi Ando > > -- "Bízzál Istenben és tartsd szárazon a puskaport!".-- Cromwell