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 trialChloe Evans-Cross
4,761 PointsgetArea not defined? My code is the same
So I've written the same code as far as I can tell, put when I paste getArea(10, 20); into the console I get: VM116:1 Uncaught ReferenceError: getArea is not defined at <anonymous>:1:1
But isn't it defined by the code in the js file?
Thanks!
1 Answer
Steven Parker
231,141 PointsThe script is not being loaded because it is located in a sub-directory, and that needs to be named in the "src" path:
<script src="js/multiple-args.js"></script> <!-- note "js/" added to src -->