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 JavaScript Loops, Arrays and Objects Tracking Data Using Objects The Build an Object Challenge, Part 2

The Objects won't print to the page

I can't print the objects using the function "print". I have gone to the video, The Student Record Challenge, and launched the workspace there and viewed it but even then it would just show the header "Students" with a blank space beneath it.

Here is the function...

function print(message) {
  var outputDiv = document.getElementById('output');
  outputDiv.innerHTML = message;
}
Colin Marshall
Colin Marshall
32,861 Points

Please edit your post and add the entire javascript code and html, not just the print function. Use the markdown cheat sheet to see how to properly post code on the forum using three backticks.

1 Answer

Nevermind now its working. Not sure what was wrong.

Colin Marshall
Colin Marshall
32,861 Points

I've experienced a lag in workspaces sometimes when previewing. It doesn't get updated right away. To check if this is happening you can do a view source on the preview to make sure your latest revisions are present in the preview's source.