Asking
Only logged in members can reply and interact with the post.
Join SimilarWorlds for FREE »

I have a question about Node.js 😬😓

With JavaScript you can write: document.getElementByID
— But with Node.js "document" doesn't exist.

So what's the Node.js version of "document.getElementByID"?
This page is a permanent link to the reply below and its nested replies. See all post replies »
Northwest · M
Apples and Oranges. A typical web application, is two main parts: frontend and backend.

The frontend handles displaying the information in your browser.

The backend handles interfacing with databases, API services, networking services, security services, etc.

On the frontend, the basic level (plumbing) is the DOM, and you can manipulate it directly via Javascript. So, you have things like document.getElementByID.

Node.js, on the front end, manifests itself through Modules that allow you to write "Views". Typically, these "Modulees" prescribe specific templates, to write views. Within these views, the ID is used as a wrapper for code that describes what happens inside the DOM element identified by the ID, without the need to do document.getElementByID.

You will have to look up the reference material for the specific Module/technology to produce these views/flow. One of the most popular is React. But I suspect, given your question, that you may need to do some basic prep work, before going into the innards of Node.js.
Entheesa · 31-35, F
@Northwest Thank you so much for this explanation. And you're right, I'm too all-over the place. I've been learning JavaScript for starters, and wanted to write some code myself, which lead to downloading Node.js. Then my head exploded.
Northwest · M
@Entheesa [quote]Then my head exploded.[/quote]

🤣

You should stick to learning Javascript for now. If you can even avoid everything related to the web, and focus on the Javascript language itself.

Once you've mastered that, you should take a DOM course.

Then take an HTML course.

Then take a CSS course.

Then you're ready to learn how to be a front-end programmer, with these building blocks mastered.

From that point on, you will be dealing with higher level environments. Manipulating the DOM, today, is akin to an electrical engineer, designing a circuit a single gate at a time, all 5 billion of them, for a single modern chip, when then can select a 5million gate filter, using a single element from a library.

And if you focus on the basic building blocks, you will make a far better programmer than a lot of the people whose resumes pass my desk every day.
Entheesa · 31-35, F
@Northwest Thank you, I really appreciate your advice. I've made a note of the order you suggest I learn these things. 😎