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 trialJoshua Harman
8,821 PointsWhat's the Question in Step 2??
Am I missing something? What is the second step asking for?
And please don't just repeat the question to me...
$('#footer').load('index.html');
$('#footer').load('footer.html')
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>AJAX with JavaScript</title>
</head>
<body>
<div id="main">
<h1>AJAX with jQuery</h1>
</div>
<div id="footer"></div>
<script src="jquery.js"></script>
<script src="app.js"></script>
</body>
</html>
5 Answers
Dave McFarland
Treehouse TeacherJoshua Harman In the example you are showing, you select the #footer element two times -- you only select it once and then load the external HTML file. Chyno Deluxe's answer is correct.
Chyno Deluxe
16,936 Points$('#footer').load("footer.html");
Chase Marchione
155,055 PointsHi Joshua,
First we'll select the footer. Second, we'll call the load method and supply it with the footer.html file that was specified in the challenge.
$('#footer').load('footer.html');
Hope this helps.
Joshua Harman
8,821 Pointsi tried that...
i also tried using '#main'
Joshua Harman
8,821 PointsThank you!!! it threw me off when the quiz, by default said
" Important: The code you write in each task should be added to the code written in the previous task."
I was seriously discourage because I thought that I had learned it wrong and didn't know what the problem was!