Yes and no.
JavaScript is a client-side and server-side language.
A client-side language is one that runs on a browser, like JavaScript. A server-side language is one that runs on a web server. A good example of this would be PHP or Ruby on Rails: they're both used to create web applications but only one of them (PHP) executes client side scripts; the other (Ruby) does not.
And what about those times when you need more than just client side processing? That's where Node comes in—it allows you to write code in JavaScript that can run both on the browser and on the server!
JavaScript is used client-side and server-side.
JavaScript is used in both the client and server. The browser is considered the client. It’s where you use JavaScript to manipulate HTML, CSS and other files that reside on the client side.
The server side is where your web application runs its code on your web server (or multiple servers).
Client-side
Of course, JavaScript is used on the client side.
You may also have noticed that it's also used on the server side.
So what does this mean? Well, when you visit a website in your browser and you see it in action, JavaScript has executed client-side. This means that it was downloaded from a remote server before being run by your browser to give you some interactive functionality (like clicking buttons or scrolling down the page). It's important to note that even though these scripts are being run by your browser, they're still being initiated by something else—in this case, it's a server sending out requests for content. So as long as there is an Internet connection between yourself and whatever website you're visiting, then there's going to be some sort of communication happening between them—whether through HTTP or HTTPS protocols (or others).
Server-side
JavaScript is a server-side language. Okay, so what does that mean?
In simple terms, the server side of your application handles the logic and data that drives your application. The client side (the browser) takes in information from the server and displays it in a user interface for users to interact with. When you think about how most applications work today, this model makes sense: you're logged into Facebook or Gmail or whatever service you use every day; all of your data lives on their servers; when you fill out a form on their site or click an "Add Friend" button or upload a photo album, they send back some JSON data which gets loaded into an input field on their page by JavaScript running on their client side.
This isn't exactly true for everything—sometimes there are some scripts running directly inside of web browsers like Safari or Chrome (for example if they're embedded within an app built using Cordova/PhoneGap). But even those cases usually involve communicating with services hosted elsewhere first so as not to have everything stored locally.*
JavaScript is everywhere now.
You can use JavaScript for both client-side and server-side programming.
JavaScript is used in both the browser and on the server.
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.