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 trial

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 your browser Cache could do the trick :)

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,735 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.

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