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!
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
Marcell Ciszek7,255 Points
double quotes in AJAX
Is it only double quotes that is available when using AJAX?
Ross King20,704 Points
Hi Marcell Ciszek ,
You can use single or double quotes when using AJAX.
An example you can run in the console right now that uses double and single quotes will show you it works either way.
// Create XML HTTP Request Object var xhr = new XMLHttpRequest(); // Open the request with single or double quotes used. xhr.open("GET", 'https://teamtreehouse.com/rossking.json', false); // Send the request xhr.send(); // Log the request console.log(xhr.responseText)