Sorry, i think i was sleeping when i wrote the code hehe Its $count.data('clone_count'). My mistake. 2009/6/6 Peter Marino <marino.pe...@gmail.com>
> hi, > ok... now I tried it.. but it > seems that > > $count.('data') > > is not valid way of testing if data is there.. my javascript dies at that > point. > > peter > > On Fri, Jun 5, 2009 at 11:30 PM, Gustavo Salomé <gustavon...@gmail.com>wrote: > >> $count=$(".div_count"); >> var clone_count =!$count.('data') ?1:$cont.data('clone_count')+1; >> $count.data('clone_count',clone_count); >> >> 2009/6/5 Peter Marino <marino.pe...@gmail.com> >> >> Hi jQuery, >>> I have the following: >>> >>> if ( $(".div_count").data("clone_count")==undefined ) >>> { >>> $(".div_count").data( "clone_count", 1 ); >>> } >>> else >>> { >>> $(".div_count").data( >>> "clone_count", $(".div_count").data("clone_count")+1 ); >>> } >>> var clone_count = $(".div_count").data( "clone_count" ); >>> >>> is there any method that can do this a little simplier (compact).. >>> >>> any suggestions? >>> >>> Peter >>> -- >>> Power Tumbling - http://www.powertumbling.dk >>> OSG-Help - http://osghelp.com >>> >> >> >> >> -- >> Gustavo Salome Silva >> > > > > -- > Power Tumbling - http://www.powertumbling.dk > OSG-Help - http://osghelp.com > -- Gustavo Salome Silva