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 trialGary Calhoun
10,317 PointsThe previous challenge didn't accept double quotes?
I am not sure but the previous challenge for some reason didn't accept double quotes for some reason just out the outside of the div element?
it didn't accept this
var $overlay = $("<div id="overlay"></div>");
but accepted this
var $overlay = $('<div id="overlay"></div>');
1 Answer
Jason Anders
Treehouse Moderator 145,860 PointsHey Gary, The reason it wasn't accepted was because it was on the same line and within a set of quotes. When you need to use quotes inside of quotes, the inner quotes need to be different than the outer (enclosing) quotes. If you use the same ones, your second opening quote will be read by the compiler as the closing quote to the first opening quote. Does that make sense?
So you need to use the two kinds. It doesn't matter which ones you use inside or outside.
Example: "This quote is 'not part of this quote' but on its own" or 'This quote is "not part of this quote" but on its own'
This way the compiler know which closing quote belongs with which opening quote.
Hope that makes sense and clears it up for you. Keep Coding! :)
Gary Calhoun
10,317 PointsGary Calhoun
10,317 PointsOh wow didn't realize that thanks for clearing it up!