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 AJAX Basics (retiring) AJAX and APIs Review AJAX Methods and JavaScript Objects

need help on this short challenge guys, how will i finish the codes

1.var contact = { name : "Jill", phone: "510-555-1212" }; Finish the code below to display the object's "name" property in an alert box:

alert( )

2.Finish the code below to insert the contents of the variable "sidebarHTML" into an HTML element with the ID of "sidebar". Make sure you insert this content as HTML using jQuery.

$('#sidebar').____________ ;

4 Answers

Roy Penrod
Roy Penrod
19,810 Points

The answer your'e looking for is:

$('#sidebar').html(sidebarHTML);

Note: I checked the answer in the quiz and it passed.

contact.name,
$('#sidebar').html(sidebarHTML);
Roy Penrod
Roy Penrod
19,810 Points

That's weird, Juliette. I just tested it in the quiz again and it passed for me.

Roy

Juliette Tworsey
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Juliette Tworsey
Front End Web Development Techdegree Graduate 32,425 Points

I jumped the gun Roy. I had two semi-colons. I had spent the previous few hours reading up on what's new in Javascript via several articles and I think that I began to get some serious brain fog:-)

Roy Penrod
Roy Penrod
19,810 Points

Oh, I've been there before. Plenty of times. :-)