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 trialSoufiane Bdaoui
9,602 PointsLinking a Js file on html?
I need to link "apps.js" file on my html. I tried with:
<script src="apps.js"> </script>
It doesn't' work, what i am missing?
4 Answers
Dave McFarland
Treehouse TeacherIt's "app.js" not "apps.js" -- no 's' after app.
Jonathan Grieve
Treehouse Moderator 91,253 PointsThat should work, even without a type src attribute declaration. Are you sure your script is in the same folder as your HTML file?
Soufiane Bdaoui
9,602 PointsWell i don't know that ( is a quiz question). I tried to put some random folder name like "script", "js". But none of them worked.
Joseph Perez
25,122 PointsIt's possible that your apps.js file is in a different directory than your html file. If that's the case then you'd have to specify the exact path to your apps.js file. Instead of src="apps.js" it could maybe be src="js/apps.js". Hope that helped a little. :)
Soufiane Bdaoui
9,602 PointsYa i think that's the problem. But is a question from a quiz and i don't find anything about the folder of the js file ( i don't know if it's in the same folder or not).
Soufiane Bdaoui
9,602 PointsSoufiane Bdaoui
9,602 PointsThank you Dave