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 trialMirali Mirzayev
1,980 PointsHTML Set up
Hello Everyone could you please help me out with my HTML syntax in Atom:
<!DOCTYPE html>
<html>
<body>
<script src = "helloworld.js"></script>
<p></p>
</body>
</html>
JavaScript is not printing out into the screen because of something wrong here.
Thank you in advance.
1 Answer
robin blaauw
2,062 PointsCould be a simple problem of not referring correctly to where your javascript file is located. I always put my javascript files in a JS folder. Assuming you're working in the root folder of your project the pathing would be <script src = "js/helloworld.js"> or if you're in another folder and want to move up a directory first you could put down <script src = "../js/helloworld.js">.
If it's a problem with actual code please put down the code form your helloworld.js
Justinas Vebra
1,053 PointsJustinas Vebra
1,053 PointsThis is the correct HTML to begin with:
I assume you wanted to print out some text with the help of JavaScript, so just add this part to the helloworld.js file:
document.write("Hello, World!");
Again, the JavaScript part is shown because of the assumption. Let me know if this is helpful or more information is needed.