Thanks,
I think it will be good to put it in the layout, because of the caching.
Kfir
On 6/11/06, Bryan Duxbury <bryan.duxbury@gmail.com>
wrote:> Kfir Lavi wrote:
> > Hi,
> > If I include a javascript library, will it load when the html load, or
> > just at the first use?
> > I have table.js and I have few pages that needs it.
> > Should I include it just on the pages that needs it, or put it on the
> > application_layout?
> >
> > Thanks,
> > Kfir
>
> Most browsers will cache a script file if its not changing, which will
> be your case.
>
> As to whether or not to put the include in every page, well, that
> depends on how many of your pages actually make use of it. If its a
> signficant amount of pages, then go ahead and do it. If only a few pages
> use the JS, then include it directly in the .rhtml.
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> Rails mailing list
> Rails@lists.rubyonrails.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>