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 trialRonnie Barua
17,665 PointsWhat am I missing here?
var request = new XMLHttpRequest object;
var request = new XMLHttpRequest object();
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>AJAX with JavaScript</title>
<script src="app.js"></script>
</head>
<body>
<div id="main">
<h1>AJAX!</h1>
</div>
<div id="footer"></div>
</body>
</html>
3 Answers
Ronnie Barua
17,665 PointsThanks! I got it but I think this question is wrong and someone should fix this.
Dean Wagman
21,591 PointsHi Ronnie, you want to assign the variable to a new XMLHttpRequest(); like so
var request = new XMLHttpRequest();
The "XMLHttpRequest()" is a function that gets ran, and returns an object to you, which you then are assigning to the variable. The new keyword tells JavaScript to create a new object with that function.
Let me know if you have any questions.
:)
J Scott Erickson
11,883 Points var request = new XMLHttpRequest();
J Scott Erickson
11,883 PointsJ Scott Erickson
11,883 PointsWhat is the actual text of the question?