in-seok hwang
2009-May-22 14:02 UTC
hi all! i don''t know that javascript into the ruby variable
hi all! sorry! i''m not speak english well. but, i want to learning. this is my code. 553 text <<-JAVASCRIPT> 554 <script> > .....clipping..... > 571 function grow_window(name) > 572 { > 573 $(''name'').innerHTML = "?? : #{@people[name > ].fetch(''name'')}" > 574 Effect.Grow(''profile_grow''); > 575 } > 576 </script> > 577 JAVASCRIPT >I would like to put in javascript''s variable(name) to red point. but , i can''t remember Programming syntax. plz give me hint. thank you for reading my artcle. have a nice day. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/camping-list/attachments/20090522/0b41b774/attachment.html>
Eric Mill
2009-May-22 15:05 UTC
hi all! i don''t know that javascript into the ruby variable
That actually is not going to be possible, the way you''re doing it. ERB can''t evaluate the JavaScript like that. What you might want to do is to write the @people hash out onto the page somewhere else first, as a JavaScript hash, and then have your function look up [name] in the JS hash. -- Eric On Fri, May 22, 2009 at 10:02 AM, in-seok hwang <his2000x at gmail.com> wrote:> hi all! > > sorry! i''m not speak english well. > but, i want to learning. > > this is my code. > >> 553 text <<-JAVASCRIPT >> 554 <script> >> .....clipping..... >> 571 function grow_window(name) >> 572 { >> 573 $(''name'').innerHTML = "?? : >> #{@people[name].fetch(''name'')}" >> 574 Effect.Grow(''profile_grow''); >> 575 } >> 576 </script> >> 577 JAVASCRIPT > > I would like to put in javascript''s variable(name) to red point. > > but , i can''t remember Programming syntax. > > plz give me hint. > > thank you for reading my artcle. > > have a nice day. > > > > _______________________________________________ > Camping-list mailing list > Camping-list at rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list >