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 trialMichelle Hart
7,468 PointsEmployee status is in the wrong location
My employee status is showing up after all the paragraph text, instead of on the right hand sidebar. Any ideas??
Michelle Hart
7,468 PointsI have added the js code. Which I copied exactly from the lesson. I do not see any differences.
4 Answers
Mark Wilkowske
Courses Plus Student 18,131 PointsHi Michelle, this sounds like what I saw today but then I remembered Treehouse is Responsive so I resized the browser window to >= 1280px wide and the status shifted to where it should be.
Michelle Hart
7,468 PointsThat was exactly the issue. Thank you, I did not even consider the responsiveness.
Saskia Lund
5,673 PointsMaybe you have a typo in the selected html output element's id?
The id of the html element that the generated html should be injected into, should be addressed like this in your code:
document.getElementById('employeeList').innerHTML = statusHTML;
employeeList is the html element's id in this challenge.
Michelle Hart
7,468 Points$(document).ready(function() {
var url="../data/employees.json";
$.getJSON(url, function (response) {
var statusHTML = '<ul class="bulleted">';
$.each(response, function (index, employee) {
if (employee.inoffice === true) {
statusHTML +='<li class="in">';
}else {
statusHTML +='<li class="out">';
}
statusHTML += employee.name + '</li>';
});
statusHTML += '</ul>';
$('#employeeList').html(statusHTML);
}); //end getJSON
}); //end ready
Saskia Lund
5,673 PointsHm your jQuery Code is fine. I can't see any mistakes.
Must be something in your html then. Did you change something in the html file?
Jonathan Grieve
Treehouse Moderator 91,253 PointsJonathan Grieve
Treehouse Moderator 91,253 PointsIt could be something simple like the html you're generating having a missing or mismatched closing tag. Would you be able to post your code so we can have a look? :)