Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I have looked at the aims of Java-script and it intends to provide and enhanced user-interface and dynamic websites. I am trying to get into the Web Development Business and am learning Javascript. But unfortunately, I have never seen an entire website implemented in Java script. Javascript is usually just used for Ads. People use things like PHP or ASP .NET (and C#) for serious web development. So will learning Javascript seriously enable me to make Dynamic Websites , and are there any good websites made with Javascript. Is Javascript a good choice for making websites? Is it even possible?

share|improve this question

closed as primarily opinion-based by gnat, MichaelT, GlenH7, Kilian Foth, jwenting Sep 22 '14 at 9:19

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.If this question can be reworded to fit the rules in the help center, please edit the question.

I am also a bit confused about server-side and client-side.Can anyone please explain the difference? –  ApprenticeHacker Jul 31 '11 at 3:39
In applications, javascript is used extensively. Finding a web application written in the past 10 years that doesnt use some javascript would be very difficult, to say the least. I dont know where you get the notion its 'only used for ads'. –  GrandmasterB Jul 31 '11 at 4:54
@GrandmasterB Believe it or not, but from fully qualified web developers (and from experienced ones at that). –  ApprenticeHacker Jul 31 '11 at 8:45
They're wrong. It's that simple. –  Dori Jul 31 '11 at 8:48
Like so much else in life, the answer may be the Dunning–Kruger effect. –  Dori Jul 31 '11 at 9:02

6 Answers 6

up vote 7 down vote accepted

You're looking for node.js. It is framework that enables using javascript as a server side language.

You can also look at coffee script although it isn't technically javascript.

share|improve this answer
Have a look at the commonjs.org initiative which is defining how Javascript on the server side and client side should conform to so that apps can run either serverside or client side using the same code base in a way. –  David d C e Freitas Aug 29 '11 at 7:55

Have a look at GMail.

Very little HTML is actually sent from the server to client. The vast majority of what gets sent from the server is actually Javascript and the data in JSON format. Javascript then runs on the client to generate the HTML that the browser actually displays.

Obviously, a lot has to happen on the server to actually generate the data (and manage all of your actions, etc) but all of the rendering and user-interaction logic is Javascript.

share|improve this answer
Facebook.com is also pretty much a javascript application. –  David d C e Freitas Aug 1 '11 at 14:05

JavaScript is a client-side scripting language. Most complex websites will use a combination of various technologies to generate HTML dynamically on the server (PHP, ASP.NET, etc.) and JavaScript to provide interactivity on the client (browser). You can't really develop a useful website using just JavaScript, nor was it in anyway meant to.

In response to your question in the comment, I recommend you read up on HTTP and what exactly happens when you visit a website in a browser. But basically the "client" (the browser) makes a request to the server which then acts upon the request in some manner. For complex sites, in most cases, some code is run that provides an HTML document based upon the information in the request and information the server has in a database or some other persistent store. Whatever happens at this point is "server-side". When the server finishes doing that it returns the HTML document as a response to the client. That HTML document can include JavaScript which is then executed by the client (the browser) that can then alter the page or do any number of things (including serving ads). This is "client-side", it runs in the browser and the server is completely ignorant of it.

share|improve this answer
No longer is JavaScript only a client-side language nodejs.org –  Mchl Jul 31 '11 at 9:25
And you don't need a server to generate HTML dynamically. You can just use a connect directly to database (like couch) using HTTP and ajax. –  Raynos Jul 31 '11 at 12:50
I hope you are kidding... connecting directly to a database from JavaScript? –  Boris Yankov Aug 1 '11 at 3:09
@Boris: Why should he be? With databases that have proper rights management and are designed to work well with a seperate database account per user and have a decent HTTP interface, this is possible. CouchDB is such a database. –  back2dos Aug 1 '11 at 9:16

http://expressjs.com/ is a full stack framework. http://brunchwithcoffee.com/ can be used if the application is HTML5 only.

share|improve this answer

ASP.NET and parallel frameworks are made for server-side development. Javascript is primarily for client-side development. It is extremely popular and powerful. Without knowing what type of website you are looking to make, yes you will be able to leverage Javascript to enhance many aspects of the web. It does much...much more then just ads.

share|improve this answer

Certainly. On the client side, you can use something like extjs to essentially create an entire front end in javascript, with little or no html. On the server side, as others have mentioned, node.js can be used. Though I suspect you're asking primarily about client side development.

That being said, creating an entire client side piece in javascript can be very tedious.

share|improve this answer
It is not tedious. I much prefer to write nice looking (in large parts reusable) JS code (or actually ExtJS code since I use very little core JS APIs) than to handle HTML and CSS stuff myself (in which I have neither skill nor interest). –  Mchl Jul 31 '11 at 10:58
tedious isnt the best word, I guess. Perhaps 'demanding', in that it requires a sophisticated understanding of javascript, plus a good understanding of HTML, AJAX, DOM, etc. From a pure programmer's standpoint, it might be conceptionally easier to build an app via code, esp if one is familiar with building desktop apps since the paradigm is so similar. –  GrandmasterB Aug 3 '11 at 21:52
My point is that I actually do not need to bother myself with HTML, DOM, CSS (most of the time anyway, unless I want to add some styling to labels or buttons). AJAX handling in ExtJS is just one function call with easy callbacks. Perhaps the most demanding thing was to understand the asynchronous nature of JavaScript and the way it's variable scope behaves. Oh yeah, and from my short acquiantance with Java's Spring framework I can tell Ext JS API is in large degree similar. –  Mchl Aug 3 '11 at 22:19

Not the answer you're looking for? Browse other questions tagged or ask your own question.