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

General Discussion

Intro 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

you 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.

Thanks 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.

you'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.

how 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

how 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

text edit is not really recommended because it isn't as versatile as the more popular text editors like sublime, textMate and etc..

how can i run both files at the same time?

i 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

make 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.

thanks a lot

no problem.