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
Leslie Spencer
343 PointsIntro Programming Basics: How to follow example with index.html
In the Programming Basics video "Getting Started" Jim shows exactly how to change the Chrome view to get to the JavaScript Console. When the second video, "Writing Your Program," starts he says he has a very simple site loaded and he opens a new file and saves it as a .js in the same folder as the index.html file. Does he only have that index.html file because he created that site? If I don't have a site that I've created can I follow along with the demo by saving a .js in the same folder as an index.html file? If so where can I find that index.html file? And he edits the index.html, can I edit an index.html that's available to me? Thanks!
4 Answers
Rashii Henry
16,433 Pointsyou have to create the index.html file, that file will contain all of your html code(the structure of your site) after you have that then you can create a new tab and save it with the .js extension.
so he has the index.html file because he created sometime before. the same goes for you, i doubt a .js would be useful if you didn't have an .html file to combine it with.
All you need is a Text Editor. Otherwise, they should be available to download under the teacher's notes section underneath the video.
Leslie Spencer
343 PointsThanks Rashii!
I hasn't realized that you can open files in browsers other than by entering a URL.
In case anyone find this who had the same issue: I opened a new file in the program TextMate, I selected an HTML template, and saved it as index.html. Then in Chrome I did File -> open and selected that index.html file.
Rashii Henry
16,433 Pointsyou're welcome.
for convenience you can also save it to your desktop and whenever you click on it, it will automatically open up in a browser.
but either way works.
philemon byankya
Courses Plus Student 135 Pointshow can I create or open a new tap in textedit? seems like it is impossible. I do have the html file but the only thing left is to create another file for java in the same file. thanks
philemon byankya
Courses Plus Student 135 Pointshow can I create or open a new tap in textedit? seems like it is impossible. I do have the html file but the only thing left is to create another file for java in the same file. thanks
Rashii Henry
16,433 Pointstext edit is not really recommended because it isn't as versatile as the more popular text editors like sublime, textMate and etc..
philemon byankya
Courses Plus Student 135 Pointshow can i run both files at the same time?
philemon byankya
Courses Plus Student 135 Pointsi mean load my javascript file into the html one?yes i did insert it in the older html file but when i try to run it; it just shows what i wrote in java
Rashii Henry
16,433 Pointsmake sure you the file as the correct extension.
but you just have to organize everything into folders. and you have to include the .js file into your .html file.
philemon byankya
Courses Plus Student 135 Pointsthanks a lot
Rashii Henry
16,433 Pointsno problem.