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 Your First JavaScript Program

upon preview, the javascript didn't run. there was no popup diaogue box and no text

upon preview, the javascript didn't run. there was no popup diaogue box and no text

Hi, Brendan Whiting // code start alert("Hello_World"); document.write("Welcome_How are you??"); // code end this I had written in scripts.js Also index.html has included scripts.js

7 Answers

Clearing my cache worked right away - thank you!

Hi, Brendan Whiting // code start alert("Hello_World"); document.write("<h1>Welcome_How are you??</h1>"); // code end this I had written in scripts.js Also index.html has included scripts.js <script src="scripts.js"></script>

Brendan Whiting
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Brendan Whiting
Front End Web Development Techdegree Graduate 84,678 Points

Maybe you need to save the file and refresh. In the workspace, if there's a little orange dot beside the file name tab that means its unsaved, so if you click on the preview button you won't be previewing that version yet.

No, I am sorry to say. Even upon saving and refreshing it didn't worked. Could it an issue of Web browser? I am using Google Chrome

Kieran Corcoran
Kieran Corcoran
11,188 Points

Hi,

You may want to double check the HTML file is linked to the Scripts.js file correctly. I rarely use workspaces and prefer to use a code editor, tend to have less of these issue.

Kieran Corcoran
Kieran Corcoran
11,188 Points

Hi,

Also, did you save the file before previewing? You need to save the file first.

Jason DeValadares
Jason DeValadares
7,190 Points

I had this issue too. I had to close down the workspace after saving and then re-launching it.

Nejc Vukovic
seal-mask
.a{fill-rule:evenodd;}techdegree
Nejc Vukovic
Full Stack JavaScript Techdegree Student 36,271 Points

Or cache clearing works also. And it's a bit faster.

Sometimes it happens that the preview loads the cached version and not the changed version.

Arvid Andrè Borgersen
Arvid Andrè Borgersen
4,237 Points

Hi,

I had the same issue when i were browsing TeamTreeHouse and the workspace in Google Chrome's "Incognito mode". Switching from Incognito to regular browsing seemed to do the trick in my situation.

Hope this helps.

Best regards Arvid A. Borgersen