On Mon, Feb 13, 2012 at 2:01 AM, Dev Guy <devguy...@gmail.com> wrote: > Hi I am learning to use jQuery but I can't seem to get the following > line to work from my html.erb file > > <script type="text/javascript"> > document.write("<p>Hello from javascript!</p>") > $("<p>Hello from jQuery!</p>") > </script> > </p> > > > I see the output for the basic javascript call, but nothing from > jQuery, what am I doing wrong? > > I know Rails 3.2 comes with jQuery installed and I do see it in the Gemfile: > > gem 'jquery-rails' > >
I figured out I need to use: $("<p>Hello from jQuery!</p>").appendTo('body') -- Kind Regards, Rajinder Yadav SafetyNet Test Driven Development http://safetynet.devmentor.org -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.