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
HanJoon Kim
Full Stack JavaScript Techdegree Student 15,388 PointsIt seems like jQuery ".load()" is not working. What's the right alternative?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>AJAX with JavaScript</title>
<link href='http://fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/main.css">
<script src="http://code.jquery.com/jqeury-1.11.0.min.js"></script>
<script>
function sendAJAX() {
$('#ajax').load('sidebar.html');
}
</script>
</head>
<body>
<div class="grid-container centered">
<div class="grid-100">
<div class="contained">
<div class="grid-100">
<div class="heading">
<h1>Bring on the AJAX</h1>
</div>
<button id="load" onclick="sendAJAX()" class="button">Bring it!</button>
<div id="ajax">
</div>
</div>
</div>
</div>
</div>
</body>
</html>
This is my code which is exactly the same code on the video.
It seems that the $('#ajax').load('sidebar.html'); this part of the code is not working properly.
What would make this code working?
-AJAX Basics - Introducing jQuery-
1 Answer
Bjorn Beishline
14,753 PointsThere is nothing wrong with your code, it's just that you misspelled jquery. You wrote the cdn link as
<script src="http://code.jquery.com/jqeury-1.11.0.min.js"></script>
when it should have been
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
notice how you spelt jquery as jqeury