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 trialJ MAC
7,944 PointsJQuery & AJAX Section Stage 3 - First Challenge - Error?
Challenge task 1 of 2 In the app.js file, use jQuery to select the footer div of the web page. Look at the index.html file to see how the HTML is structured.
Bummer! When selecting a page element with jQuery, pass a CSS selector to the $() method.
Code that I Included inside app.js
function sendAJAX() {
$('#footer').load('footer.html');
}
I added <script src="http://code.jquery.com/jquery-1.11.0.min.js" type="text/javascript" charset="utf-8"></script> in head of index.html, near the footer of index.html and even in the top of app.js Nothing works and I am stumped!
5 Answers
Andrew Kiernan
26,892 PointsHey Jann!
I like where your head's at keeping your code contained in a function, but I think that may be what is throwing off your answer. If you pull $('#footer').load('footer.html') out of your function and submit it that way it should work!
Let me know if you need anything else!
-Andrew
ellie adam
26,377 Points$('#footer').load('footer.html')
J MAC
7,944 PointsThanks, Andrew. I guess I got ahead of the challenge there. That was the fix. Greatly Appreciated!
Anthony Boardman
4,672 PointsI'm stuck on the same chagllen I've tried everything I can think of and I can't pass it to save my life. Any chance you could help.
Andrew Kiernan
26,892 PointsHey Anthony.
I'd be happy to help!
Assuming it is the exact same challenge, you want to use the $('#footer').load method above, but don't wrap it in any type of function or anything and it should pass.
If its a different issue, just post what it is and what you've tried and I'll give it my best shot.
-Andrew
Anthony Boardman
4,672 PointsThat was a big help! Thanks I've been stressing at that for a few days! The questions are all easy they just don't word some of them as well as they could!
Thanks again! :)
Erik Robles
Courses Plus Student 10,635 PointsErik Robles
Courses Plus Student 10,635 PointsYes. This one really stumped me to as I added everything. I didn't know they just wanted the guts of the function and not the whole function and its insides as well.