Properly loading JQuery on Rails (object has no method) -
i working on course posted @ http://schneems.com/ut-rails. here app working with: https://github.com/schneems/ruby_javascript_data_viz.git.
i using rails 3.2.6 , ruby version 2.0.0p247.
i have cloned file desktop, installed bundle, , set database. when use console (chrome) see if jquery working, error:
> $('body').hide(); type error: object #<htmlbodyelement> has no method 'hide'
when view page source see if jquery loading, can see line:
<script src="/assets/application.js?body=1" type="text/javascript"></script>
however, don't see jquery. missing here?
i have searched issue, , have found many similar questions, can't seem find me going.
thank you!!
make sure jquery plugin loaded , document ready before using hide() function.
wrap code in
$(function() { $('body').hide(); }
and try.
Comments
Post a Comment