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 trialLotte Bloem
18,630 PointsI still get a error, what am i doing wrong?
It says i miss the " " in line 2. And when i delete that hole line, it's still giving me that error!
alert("Help me fix this program!");
alert("Can you get this message to appear?");
document.write("<h2>My first JavaScript program</h2>");
document.write("<p>I'm practicing 'debugging'.</p>");
3 Answers
Lotte Bloem
18,630 PointsHi Bobby, this is my first time that i use this forum. Can you please explain how i can add the code in here?
Konrad Pilch
2,435 PointsA fast thingy I did for you is here your look beautiful as well.
Bobby Verlaan
29,538 PointsI see the end of the message wasn't the creative part, but the actual code you wrote that makes the error! With the markup added now I can read it :-). Looks like Nejc already got you covered! Escaping with \ should work. Keep in mind that double quotes and single quote can be used together as long as they are inside eachother:
- " hello you're good " <-- good
- ' hello you're good' <-- bad
To test Nejc advice. Create a .html file on your computer, edit it with notepad (or other texteditor), save your code in the document and open up the html in your own environment. As far as I can see that should work :-)
Konrad Pilch
2,435 PointsThere are few sublime text editors like sublimetext2/3 , brackets, coda, notepad++ and so on. I recommend to set the screen on black background, it will save your eyes in long term .
Nejc Vukovic
Full Stack JavaScript Techdegree Graduate 51,574 PointsHi as you have written the code looks fine and I think the debugger is giving a false error:
//this is your line
document.write("I'm practicing 'debugging'.");
//use this instead
document.write("I\'m practicing 'debugging'.");
//the ' should be escaped -> "I\'m ...
If I'm not mistaken then this could be a problem -> You have to look at it like this -> the ' in I'm opens a string literal and hte second ' at 'debugging closes it and then debugging' opens another string literal that isn't closed.
You should use an escape character for the ( I'm ) like I have written in the code above.
Try it and give some feedback.
Happy Coding!!!
Lotte Bloem
18,630 PointsAh tnx guys! it's works now!
Bobby Verlaan
29,538 PointsBobby Verlaan
29,538 PointsHehe. Creative brief! Could you please add your code as well? Then we can look into what the problem might be. Chances are you have missed the ; symbol on line 1.