Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

JavaScript JavaScript Basics (Retired) Introducing JavaScript The JavaScript Console

Dongeui Hong
Dongeui Hong
1,529 Points

I put exactly same code as instructor did, but mine still has some error. But, it does not have to appear the error.

I put exactly same code as instructor did, but mine still has some error. But, it does not have to appear the error.

Jason Anders
Jason Anders
Treehouse Moderator 145,547 Points

Hi Dongeui,

You will need to post your code for us to be able to help you. Without seeing the code, it is impossible for people in the forum to troubleshoot the problem.

For more information on posting code in the forum, please see this post

If you are wanting to post from a Workspace, you just need to take a snapshot (camera icon) and post the link that is generated.

:)

Dongeui Hong
Dongeui Hong
1,529 Points
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>");
console.log("End program.");

this is my code, but when I clicked preview botton in Workspaces, it has not been changed anything. I think code is absolutely correct because thats what instructor did. I might think this problem is involved in certain sort of settings? Please help me. Thanks

MOD NOTE: added markdown for proper code viewing.

2 Answers

Franklin Tarter
Franklin Tarter
12,341 Points

The code you wrote works for me in Safari with no errors. So I think you are correct the problem is not with the code itself. Do you have javascript enabled in your web browser?

http://enable-javascript.com/

Also you might double check the index.html file to make sure there are no errors there.

Josue Gisber
PLUS
Josue Gisber
Courses Plus Student 9,332 Points

i had the same problem too but when i reload the browser it worked. So if you debug your code on the workspace and when you click preview and still doesn't work, just hit reload on the browser and it will work.