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 trialBlake Hutchinson
21,695 PointsAdding to the CSS file (main.css) is going to be necessary to get the page to look like the way Dave has it.
I added to the widget.js file just like he did. To get it to show up on the index.html page, I added a DIV tag above the "Employee Office Status" H2 line.
<aside class="grid-30 list"> <!-- pre-existing code -->
<h2>Meeting Rooms</h2>
<div id="roomList">
</div>
In the main.css file it looks like the "ul.rooms .empty:before" would almost match the code below except that for that the content value would be dynamic for "ul.rooms .empty:before". I'm not sure how that would be done.
ul.bulleted .in:before {
content: "IN";
background-color: #5fcf80;
}
I created the rooms.json file inside the data directory.
[
{
"room": 101,
"available": false
},
{
"room": 102,
"available": true
},
{
"room": 103,
"available": false
},
{
"room": 104,
"available": false
},
{
"room": 105,
"available": true
},
{
"room": 106,
"available": true
}
]
It's going to take some tweaking of the main.css file to get the index.html page to look just like the instructor's.
1 Answer
Dave McFarland
Treehouse TeacherThere's a new workspace on that challenge page http://teamtreehouse.com/library/ajax-basics/programming-ajax/stage-2-challenge
That workspace has the required HTML, CSS and JSON files already in place. You don't need to add that yourself, but it looks like you did, so good job!!!
Blake Hutchinson
21,695 PointsBlake Hutchinson
21,695 PointsAt the time of this post this is how I have my main.css code and the result isn't looking so good. I know I'm going to have to unpair the ul.rooms code from the ul.bulleted code for the most part.
When you look at Dave's "Meeting Rooms", he has the room numbers inside the boxes, and like I was saying, that looks like that was done dynamically. The way I would do it is to add some styles using the DOM for the statusHTML variable after the closing brace for the for loop.