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 trialSarthak Handa
1,884 Pointsupon 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
Sarthak Handa
1,884 PointsHi, 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
Nejc Vukovic
Full Stack JavaScript Techdegree Graduate 51,574 PointsClearing your browser Cache could do the trick :)
Mike Murray
1,171 PointsClearing my cache worked right away - thank you!
Sarthak Handa
1,884 PointsHi, 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
Front End Web Development Techdegree Graduate 84,738 PointsMaybe 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.
Sarthak Handa
1,884 PointsNo, 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
11,188 PointsHi,
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
11,188 PointsHi,
Also, did you save the file before previewing? You need to save the file first.
Jason DeValadares
7,190 PointsI had this issue too. I had to close down the workspace after saving and then re-launching it.
Nejc Vukovic
Full Stack JavaScript Techdegree Graduate 51,574 PointsOr 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
4,237 PointsHi,
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
Brendan Whiting
Front End Web Development Techdegree Graduate 84,738 PointsBrendan Whiting
Front End Web Development Techdegree Graduate 84,738 PointsCan you post your code?