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.
Matthew Stein4,140 Points
Hi. When I launched the workspace it contained the original scripts.js file with the two syntax errors. As per instructions I fixed the errors and saved the scripts.js file. But the Preview function still loads the original code with the errors. Here is the corrected text that appears on my scripts.js screen (after saving it): alert("hello there"); document.write("No it works!");
But when I open the console this is what I see: scripts.js: 1 Uncaught SyntaxError: missing ) after argument list
alert(hello there"); document.rite("No it works!"); (Somehow it is not seeing the added "w". No matter what I do the Workspace screen paints the word "write" in red, as if it is still misspelled "document.rite").
Matthew Stein4,140 Points
Thanks for responding. Yes I saved the file before repreviewing. There seems to be a caching issue with the Workspace component -- probably because the normal navigation components are disabled (in the stand-alone window). After searching the community form and Chrome support I figured out how to resolve it. After saving the corrected file I need to click Preview (which opens the index.html with the original errors) and then refresh the browser's cache (on a Mac I held down Shift and clicked the Refresh arrow in the browser's toolbar). I'm not sure that most beginners taking this course would figure out what's going on.
Sounds like it's not refreshing. Did you save the file before previewing? Maybe close and reopen the workspace to force the preview to refresh?
I've had similar problems on Windows. I usually close the preview window and hit the preview icon again and it will refresh. Refreshing the original window never seems to work. I think refresh is "f5" on Windows, but closing and reopening has been more useful for me.
Confirmed. The browser (Chrome in my case) is caching the original files. Refreshing the page after it opens executes the newly-saved code.