Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript Using jQuery Plugins Using a jQuery Carousel Add a Carousel to a Page

Alex G.
Alex G.
10,329 Points

Why not "call" the slick method in main.js?

I'm not really seeing the advantage of calling it in the HTML page... is this to prevent the other pages from slowing down? He didn't do that in the other videos.

2 Answers

there is no benefit to calling it in the HTML you can call it in main.js if you wish, Slick is a very forgiving carousel and can also be used via CDN. make sure to have it included after jquery though.

Jamie Reardon
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Jamie Reardon
Treehouse Project Reviewer

As the teacher says (around the 3:20 mark somewhere "ish"), he is only putting it on the one page, so he just went along with adding it directly to the HTML of the page. He is probably also showing you how to apply the jQuery and JS directly.