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 trialGerry K
5,877 PointsGetting error: content is not defined
Here's a snapshot of my code http://w.trhou.se/m6xeqc93j1
When I go to run this and load up the web page I get the content is not defined error message, I assume that the program is trying to access the content variable outside the scope of the function that it is being set it. ( i.e. that was replaced in the for loop in mergeValues function in renderer.js).
Where did this variable come from in Andrew's code?
Thank you!
1 Answer
Steven Parker
231,248 PointsThe variable "content" should be a passed-in argument.
But in your definition of mergeValues, you wrote "contents" (with an "s") instead of "content".
Gerry K
5,877 PointsGerry K
5,877 PointsThanks I have updated that but now when I add a username ( .../username ) I get another server issue saying: TypeError: content.replace is not a function
Steven Parker
231,248 PointsSteven Parker
231,248 PointsThat could be related to the encoding. Have you gone all the way to the end of the video where that is discussed?
J llama
12,631 PointsJ llama
12,631 PointsSteven you need to stop commenting on posts... you give worthless information time and time again and it is quite frustrating for new js users like myself (and apparently yourself)...
Steven Parker
231,248 PointsSteven Parker
231,248 PointsI don't understand your comment, "J". I enjoy helping people (and don't find it frustrating). And this information was clearly of value to Gerry (2 years ago!). Perhaps you have a slightly different issue that this answer doesn't address.
If you do, try starting a fresh question where you can get a more specific answer for your own issue (and not necessarily from me).