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

Kevin Faust
15,353 Pointshow do i combine normal javascript with something like node.js
by normal javascript i mean like brower javascript so javascript/jquery/ajax.
going through the js track, i was able to see how i can use ajax and jquery with javascript when building a website and its not hard to incorporate (just add the right script tag and your good to go). but when it comes to node, i dont know how i would add that.
ive never done any server side stuff so im a bit confused. and the node.js course is pretty short and just dives straight into node without actually explaining how you connect the things.
if im building a site with workspaces and decide i want to incorporate node (or something similar), how would i add it?
thanks
3 Answers

miikis
44,957 PointsThere’s only one type of JavaScript; the “browser” JS and “node” JS are the same exact language. In practical terms, the only things that are different between the two environments are the global variables you have access to. For example, in the browser, you have the global “window” that doesn’t exist in nodeJS and nodeJS has a shit-ton of globals that don’t exist in the browser, like “require.”
As for “connect[ing] the things,” check out the Express Basics Course here on Treehouse. Express is this JavaScript framework — kind of like jQuery, except jQuery is a library — that makes it super-duper simple to build the server-side part of a given website. In fact, I recommend you complete the entire Full-Stack JavaScript Track while you’re at it.
I get your confusion; it’s all a bit confusing to everyone at first. You kinda just have to trust that it’ll all make sense eventually. Feel free to let me know if I haven’t answered your question.

Arturo Alviar
15,739 PointsHi Kevin,
So as you mentioned, Node.js runs in the backend and the Node course here at Treehouse gives you a nice foundation to understand what Node is. Remember that Node is a back-end so it will mainly handle routing, database interactions, and template rendering. As you probably already know, JavaScript that manipulates the DOM is not part of Node. JavaScript files that contain code to manipulate the DOM would be considered static files. Static files can just be added to a template html file.
I would recommend taking a look at the Express Basics course since it helps answer your question in more detail. Link to Express.js
After that, you should check out Deploy a Node Application to Heroku
Hope this helps.

Kevin Faust
15,353 PointsThanks for the response guys. I am doing the full stack js track at the moment and Express will come after the Node and npm sections.
Joshua Erskine
7,706 PointsJoshua Erskine
7,706 PointsSecond that question.