From: Brian Candler Date: 2009-11-29T19:52:19+09:00 Subject: Re: erb and js question Derek Smith wrote: > Erm, I missed the obvious thing there, which is that you're not loading jquery properly. If your browser is loading the page directly from disk into your browser with a file:// URL, then you'd want src="file:///usr/local/vrep/test/public/javascripts/jquery-1.3.2.min.js" If you're serving the page from a webserver, then you'd just want src="/javascripts/jquery-1.3.2.min.js" There is a Rails helper you can use instead: <%= javascript_include_tag "jquery-1.3.2.min.js" %> This also does some clever stuff appending the timestamp of the file to the URL, so if you change the file on disk it forces the browser to fetch the new version. > The best practice would be for this script to live in the of your document. Note that jQuery( ..function.. ) sets up an onLoad handler which calls your function only when the entire page is loaded, so it's OK to set this early because it won't be run until later. -- Posted via http://www.ruby-forum.com/.