Hi, I have this code: var alldrags = $$(''#dragGame'' + gameCount ''.dragMe''); But it''s causing an error somehow. I''''m trying to say select all div''s with dragMe class inside the dragGame (plus an incrementing number) div but this is throwing an error saying my function is not defined. I''ve also tried assigning the dragGame selector to a variable....like so: var dragGame = ''#dragGame'' + gameCount; and then doing the selector like so: var alldrags = $$(dragGame ''.dragMe''); Both ways are throwing an error saying my function isn''t defined. Any ideas? Thanks --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
You just missed the plus (+) sign. It should be like this: var alldrags = $$(''#dragGame'' + gameCount + ''.dragMe''); and var alldrags = $$(dragGame + ''.dragMe''); :) elduderino wrote:> Hi, > > I have this code: > > var alldrags = $$(''#dragGame'' + gameCount ''.dragMe''); > > But it''s causing an error somehow. I''''m trying to say select all div''s > with dragMe class inside the dragGame (plus an incrementing number) > div but this is throwing an error saying my function is not defined. > > I''ve also tried assigning the dragGame selector to a variable....like > so: > > var dragGame = ''#dragGame'' + gameCount; > > and then doing the selector like so: > > var alldrags = $$(dragGame ''.dragMe''); > > Both ways are throwing an error saying my function isn''t defined. > > Any ideas? > > Thank--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, Thanks for the reply. I don''t think that''s it....that''ll give me #dragGame1.dragMe as the + has concatenated the whole thing. I have tried it but it doesn''t work. From looking at the api docs theres an example like this...: $$(''#contents a[rel]''); // -> all links inside the element of ID "contents" with a rel attribute So i''m assuming that using a space is what needs to be done to select everything in the dragGame1 div taht has a class of dragMe. On Jun 27, 11:19 am, Rudy Susanto <rudy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You just missed the plus (+) sign. > > It should be like this: > > var alldrags = $$(''#dragGame'' + gameCount + ''.dragMe''); > > and > > var alldrags = $$(dragGame + ''.dragMe''); > > :) > > elduderino wrote: > > Hi, > > > I have this code: > > > var alldrags = $$(''#dragGame'' + gameCount ''.dragMe''); > > > But it''s causing an error somehow. I''''m trying to say select all div''s > > with dragMe class inside the dragGame (plus an incrementing number) > > div but this is throwing an error saying my function is not defined. > > > I''ve also tried assigning the dragGame selector to a variable....like > > so: > > > var dragGame = ''#dragGame'' + gameCount; > > > and then doing the selector like so: > > > var alldrags = $$(dragGame ''.dragMe''); > > > Both ways are throwing an error saying my function isn''t defined. > > > Any ideas? > > > Thank--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Then, it should be like this: var alldrags = $$(''#dragGame'' + gameCount + '' .dragMe''); or more specific var alldrags = $$(''#dragGame'' + gameCount + '' div.dragMe''); elduderino wrote:> Hi, > > Thanks for the reply. I don''t think that''s it....that''ll give me > #dragGame1.dragMe as the + has concatenated the whole thing. I have > tried it but it doesn''t work. From looking at the api docs theres an > example like this...: > > $$(''#contents a[rel]''); > // -> all links inside the element of ID "contents" with a rel > attribute > > So i''m assuming that using a space is what needs to be done to select > everything in the dragGame1 div taht has a class of dragMe. > > > > On Jun 27, 11:19 am, Rudy Susanto <rudy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > >> You just missed the plus (+) sign. >> >> It should be like this: >> >> var alldrags = $$(''#dragGame'' + gameCount + ''.dragMe''); >> >> and >> >> var alldrags = $$(dragGame + ''.dragMe''); >> >> :) >> >> elduderino wrote: >> >>> Hi, >>> >>> I have this code: >>> >>> var alldrags = $$(''#dragGame'' + gameCount ''.dragMe''); >>> >>> But it''s causing an error somehow. I''''m trying to say select all div''s >>> with dragMe class inside the dragGame (plus an incrementing number) >>> div but this is throwing an error saying my function is not defined. >>> >>> I''ve also tried assigning the dragGame selector to a variable....like >>> so: >>> >>> var dragGame = ''#dragGame'' + gameCount; >>> >>> and then doing the selector like so: >>> >>> var alldrags = $$(dragGame ''.dragMe''); >>> >>> Both ways are throwing an error saying my function isn''t defined. >>> >>> Any ideas? >>> >>> Thank--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
YES! That''s it! Why didn''t i think of that?! Thanks for your time Rudy :) On Jun 27, 11:58 am, Rudy Susanto <rudy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Then, it should be like this: > > var alldrags = $$(''#dragGame'' + gameCount + '' .dragMe''); > > or more specific > > var alldrags = $$(''#dragGame'' + gameCount + '' div.dragMe''); > > elduderino wrote: > > Hi, > > > Thanks for the reply. I don''t think that''s it....that''ll give me > > #dragGame1.dragMe as the + has concatenated the whole thing. I have > > tried it but it doesn''t work. From looking at the api docs theres an > > example like this...: > > > $$(''#contents a[rel]''); > > // -> all links inside the element of ID "contents" with a rel > > attribute > > > So i''m assuming that using a space is what needs to be done to select > > everything in the dragGame1 div taht has a class of dragMe. > > > On Jun 27, 11:19 am, Rudy Susanto <rudy...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > >> You just missed the plus (+) sign. > > >> It should be like this: > > >> var alldrags = $$(''#dragGame'' + gameCount + ''.dragMe''); > > >> and > > >> var alldrags = $$(dragGame + ''.dragMe''); > > >> :) > > >> elduderino wrote: > > >>> Hi, > > >>> I have this code: > > >>> var alldrags = $$(''#dragGame'' + gameCount ''.dragMe''); > > >>> But it''s causing an error somehow. I''''m trying to say select all div''s > >>> with dragMe class inside the dragGame (plus an incrementing number) > >>> div but this is throwing an error saying my function is not defined. > > >>> I''ve also tried assigning the dragGame selector to a variable....like > >>> so: > > >>> var dragGame = ''#dragGame'' + gameCount; > > >>> and then doing the selector like so: > > >>> var alldrags = $$(dragGame ''.dragMe''); > > >>> Both ways are throwing an error saying my function isn''t defined. > > >>> Any ideas? > > >>> Thank--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Right. In CSS a space means "any descendant of." So "div.someClass" means all divs with a class of someClass, while "div .someClass" means any element with a class of someClass that is a descendant of any div. -Fred On Fri, Jun 27, 2008 at 5:31 AM, elduderino <jamesfiltness-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> > Hi, > > Thanks for the reply. I don''t think that''s it....that''ll give me > #dragGame1.dragMe as the + has concatenated the whole thing. I have > tried it but it doesn''t work. From looking at the api docs theres an > example like this...: > > $$(''#contents a[rel]''); > // -> all links inside the element of ID "contents" with a rel > attribute-- Science answers questions; philosophy questions answers. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
You want a selector of: #dragGame<n> <space> .dragMe Where n is the value of gameCount? That''s $$(''#dragGame'' + gameCount + '' .dragMe''). Note the space. You were on the right track, but in JS you always need an explicit + to do string concatenation. -Fred On Fri, Jun 27, 2008 at 4:20 AM, elduderino <jamesfiltness-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> > Hi, > > I have this code: > > var alldrags = $$(''#dragGame'' + gameCount ''.dragMe'');-- Science answers questions; philosophy questions answers. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hi there, Yes i''m ok with concatenating in javascript but i really didnt think i needed to concatenate the dragme class on to the end...but it seems so! Thanks On Jun 27, 1:57 pm, "Frederick Polgardy" <f...-SMQUYeM9IBBWk0Htik3J/w@public.gmane.org> wrote:> You want a selector of: > > #dragGame<n> <space> .dragMe > > Where n is the value of gameCount? > > That''s $$(''#dragGame'' + gameCount + '' .dragMe''). Note the space. > > You were on the right track, but in JS you always need an explicit + to do > string concatenation. > > -Fred > > On Fri, Jun 27, 2008 at 4:20 AM, elduderino <jamesfiltn...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> > wrote: > > > > > Hi, > > > I have this code: > > > var alldrags = $$(''#dragGame'' + gameCount ''.dragMe''); > > -- > Science answers questions; philosophy questions answers.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Spinoffs" group. To post to this group, send email to rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---