Normally JavaScript runs on the client side (browsers) only.
A Developer can also write event driven code on JavaScript which can be execute some function on event and can be run on some engine.
So that I am a bit confused and I have this questions:
1) Where does simple JavaScript runs, ClientSide or ServerSide?
2) What does the "Normally JavaScript runs on the client side" means?
3) Where can I read some references to this?
Why the downvotes?
Are you all special snowflakes who can't help a fellow programmer without downvoting? Harsh, harsh people. May the hate you carry within your hearts consume your souls.
Basically, JS nowadays can be run on both client-side and server-side as well.
Being straightforward to answer the question, two simple examples:
On client-side, you can use JS to implement some logic based on user interactions, for eg, when a user ticks a checkbox, hovers a div to change its color, whatever, JS code can be executed as a response to these events and this is typically client-side code, because it all happens on client-side based mostly in response to user interactions.
Recently, nodeJS, all to be coded in JS, is a server-side technology which allows you to consume APIs, access DBs, etc, which are server-side actions, all using JS.
So, long story short: it can be executed in both client and server-side.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With