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 trialMicole Noddle
5,797 PointsCan't load my code into Chrome?
I've read all of the threads asking similar questions but am still having problems.
I wrote the code in Notepad ++ (I have a PC). I copied Jim's HTML and saved it as an index.html file. I then created a separate file called myscript.js and copied his code. Both files are saved on my computer in a folder called "localtreehouse".
I also opened a new workspaces. Copied Jim's HTML and saved it as an index.html file. Created a separate file called myscript.js and copied his code.
I can't open my Notepad ++ file in Chrome. Have no idea how to do it, have tried, believe me! Chrome is NOT my default browser.
So then I went back to workspaces and there is nothing showing up in the console.
What do I do from here? Can someone please help me open up the Notepad ++ file in Chrome?
Also, any ideas as to why the workspaces console isn't doing anything?
Apologies for the long post. Thanks in advance for your help!
miikis
44,957 PointsAlso, when you say "nothing is showing up in the console," what exactly were you expecting to show up? Did your myscript.js file have content inside of it that wrote to the console (console.log statements maybe?)?
Micole Noddle
5,797 Points@Julian- trying to open my index.html file in Chrome. Am able to do that but having additional problems, see my post below :)
3 Answers
miikis
44,957 PointsHi, So just to clarify, you're just trying to open the index.html file, right? If this is the case, usually you'd just double click it. Since Chrome is not your default browser, you'd have to either open the file from within Chrome (by going to File->Open etc.) or, at least on a mac, if you right click on the index.html file, a context menu appears that lets you choose what program to open the file with.
But if you're just confused as to how the code in the myscript.js file fits into the picture — it's "linked in" through a 'script' tag in the index.html file. You don't actually need to open the myscript.js file in Chrome.
Hope that helps.
Micole Noddle
5,797 PointsHi Mikis,
Yes, I'm trying to open the index.html file. I should clarify...I am able to open it in Chrome and everything shows up (index.html and myscript.js), but I can't make any changes to it. The teacher seems to be adding straight to Chrome, and says our file should be saved in Chrome (makes no sense to me, I thought code could only be saved to an editor or workspaces). I'm not on a Mac, I'm on a PC, so I have to open things differently. I'm confused as to how he's getting the index.html SAVED into Chrome (that makes no sense to me).
When I say nothing shows up in the console, I mean if I am using workspaces. I created an index.html and myscript.js page in both Notepad ++ and workspaces. Same code entered in both, and yes there is content in the myscript.js (console.log statements). Nothing shows up in the workspaces console. What gives there?
I also threw the code into a JSBin, which works fine, but that gets annoying since I don't want to have to copy and paste the code every time I start a new lesson. I also have no idea where this course is heading and if we are going to need our code to build on from previous lessons, in which case JSBin isn't a good idea.
Hope that makes sense, brain's a little fuzzy after all of that. JavaScript has been really tough for me. I find it incredibly confusing, and all of this throwing it into Chrome stuff is making it worse!
Micole Noddle
5,797 PointsOh, and would you look at that...Treehouse just removed this course from the Front End track and replaced it with new JavaScript courses! Into to programming is gone. Problem solved, I suppose.
miikis
44,957 Points"I thought code could only be saved to an editor or workspaces."
You thought correctly. Browsers do not save any modifications back to the original files. That being said, you can manipulate the rendered page, from within the browser as much as you want... it's just any changes will disappear the second you terminate the session/page.
The WAY you manipulate the page from within the browser is the console; Chrome has a decent console interface. That's probably what you saw the instructor doing — typing code into the console. It's still temporary though and Chrome does not save it back to the original HTML file.
"Nothing shows up in the workspaces console. What gives there?"
I don't really use Treehouse's Workspace that much so I couldn't help you there. But if you have a console.log statement in Chrome and it's not showing up in the console, it's more than likely a syntax error (forgot a parenthesis or something) or maybe a logic error (if your console.log statement is wrapped in an IF statement etc).
miikis
44,957 PointsAlso, Treehouse usually provides updated project files for each consecutive lesson, so don't worry about having to follow along on the mock project from the very beginning and getting lost; you can always just download the next video's updated project files and start from there. I think it's better this way as it lets you concentrate more on learning the concepts being demonstrated rather than worrying about having perfect syntax. You can always do a quick project of your own right after the lesson to make sure you retained what you were intended to retain.
Anyways, there's my two cents — good luck with your learning.
Micole Noddle
5,797 Points@Mikis, the console.log statements are showing up in the Chrome console and the JSBin console, just not workspaces console, so I know the syntax is fine (they were super basic statements, btw). I'm trying to use a text editor as much as I can too (because that's what I will be using in the future), however, workspaces is part of many of these courses. Once I couldn't get my Notepad ++ to load into Chrome I tried to use Workspaces since Workspaces has a console. Figured it would be easier to see. Can't figure out why the console doesn't work in Workspaces. Now that this course is apparently pretty much retired and has been replaced with two new JS ones (much more in depth as well), I'm sure there will be a better way of handling all of this.
Haven't gotten to the if/else statements yet, this was just an intro to programming with some super basic JS in it. Please tell me that one day I will go from loathing JS to actually liking it. I haven't enjoyed it so far (loops, arrays, if/else, you name it I get a headache!...HTML and CSS are so much more fun.) I'm hoping learning it through Treehouse will make a difference. I need a JS pep talk big time.
Micole Noddle
5,797 Pointsooops sorry, just saw your second comment. Part of the problem with this course was that there was no workspaces to go with it. Thanks again for your help. Appreciate it.
Julian Gutierrez
19,201 PointsJulian Gutierrez
19,201 PointsWhat file are your trying to open on chrome?