What is the main motto of using Javascript mostly. How it will be useful for developing Applications. I know Html. How it will help me in learning Javascript. Any relations to both JS and html.
-
7Nobody's gonna just http://en.wikipedia.org/wiki/Javascript ? ~ I think this is seriously just a bogus question. – jcolebrand Aug 16 '10 at 20:41
-
1@drach - I think we are looking at a language barrier here. – ChaosPandion Aug 16 '10 at 20:43
-
@ChaosPandion ~ Perhaps so ... – jcolebrand Aug 16 '10 at 20:44
-
3I don't think JavaScript has a *motto*, but maybe it *should* have one. Any suggestions? I'll go with "'Java' in the name so it can hang out with the cool kids at Sun". :P – FrustratedWithFormsDesigner Aug 16 '10 at 20:45
-
LOL. @ ChaosPandion what is the language barrier here. – Gladiator Aug 16 '10 at 20:48
-
@frustrated: I think you meant to say, "Java in the name so it can hang out with the nerdy kids". – Jay Aug 16 '10 at 20:49
-
@Gladiator - Based off your grammar I am assuming that your native language is not English. I guess you would really call it a language hurdle or obstacle. – ChaosPandion Aug 16 '10 at 20:49
-
4Somewhere along the line I came across a FAQ that included: "Question: What is the relationship between Java and Javascript? Answer: The names begin with the same four letters." – Jay Aug 16 '10 at 20:50
-
When reading this question I assumed they meant ECMAScript rather than JavaScript. Is this the proper assumption to make? – ChaosPandion Aug 16 '10 at 20:51
-
@ChaosPandion: I saw 4 references to JavaScript (and JS), and none to ECMAScript, so I'm not sure that was a correct assumption. – FrustratedWithFormsDesigner Aug 16 '10 at 20:53
-
1@ChaosPandion @drach yes my native language is not English.when i read about JS in Wiki i cant understand all the terms which is in a good grade english. So only i came to overflow that people could help me up in normal English explaining the terms. – Gladiator Aug 16 '10 at 21:01
-
@Gladiator ~ Well, I hope I helped. In the future it helps to say "I looked at Wikipedia and I am still scratching my head" -- if you find a better way to say it than how WP has it, then update WP or post to the discussion page on that site. ~ @ChaosPandion good call on the barrier. – jcolebrand Aug 16 '10 at 21:09
13 Answers
The main use of Javascript is that it allows you to make things happen in the user's browser without sending messages back and forth to the server. There are a variety of reasons why you might want to do this.
For example, sending a message to the server and getting a reply is a relatively long process: it is almost always a noticable time lag, and can take many seconds. Doing something directly in the browser can be much faster. So if, for example, you want to give the user an "invalid data" message of some sort, it can be much faster if it comes from Javascript.
In the same vein, with Javascript you can validate field-by-field rather than waiting until the user has completely filled out the screen and clicked a submit button. For example, suppose you present the user with a screen where he's supposed to enter transaction dates and monetary amounts. The user enters a whole screen full of these -- maybe 20 or 30 transactions -- and then clicks submit. If the user attempts to type dates in a format that you don't recognize, say typing day/month/year when you expected year-month-day, then with Javascript you could give him an error on the first unrecognizable date. With a round trip to the server, he'd have typed in a whole screen-full of invalid dates before you tell him he's doing it wrong.
Similarly, trying to do animation with round trips to the server would be unlikely to work, it would be way too slow. One way to do it would be with Javascript. (There are other ways, of course.)

- 26,876
- 10
- 61
- 112
Javascript can be used for a multitude of different things.
When used alongside HTML in the browser, it can add some really cool dynamic and interactive features (compared with the historically static nature of HTML).
When used alongside a server-side engine like Node.JS, it can do just about anything any other server-side language is capable of.

- 242,243
- 40
- 408
- 536
javascript enables you to take your static html and add/make changes to it live on in the browser. Probably the main things to consider with javascript is: do not trust it for validating things, and build it in as a feature, not a requirement for making your site function (In other words, your site should still be able to function if the user has it disabled).

- 32,111
- 5
- 56
- 79
-
1+1 While not trusting for validation is a good idea to remember, it is still good to run client side validation before posting to server-side for better user experience. But you still need the server side validation too! – J.Hendrix Aug 16 '10 at 20:56
http://en.wikipedia.org/wiki/Javascript
- Blatantly ripping them off...
JavaScript is an implementation of the ECMAScript language standard and is typically used to enable programmatic access to computational objects within a host environment. It can be characterized as a prototype-based object-oriented scripting language that is dynamic, weakly typed and has first-class functions. It is also considered a functional programming language like Scheme and OCaml because it has closures and supports higher-order functions.
JavaScript is primarily used in the form of client-side JavaScript, implemented as part of a web browser in order to provide enhanced user interfaces and dynamic websites. However, its use in applications outside web pages is also significant.
It should also be noted: there is no "main motto in JavaScript" as it's a standard, not a project. For projects, check out jQuery as being the one most frequently adopted by developers on this site. There are a great many toolkits for working with JavaScript.
The main consideration when working with JavaScript is to understand that it is usually used hand-in-hand with the Document Object Model and so therefore this is where you will find most people offering ways to use JavaScript. However, it is a fully functional language, and there are ways to compile it to native machine code. An example of how this is possible is by noting that most browsers implement a just-in-time compiler for JavaScript. These JIT compilers convert the JavaScript to native bytecode for execution on the host system.
Why would you use JavaScript? You could use it for such purposes as client-side validation of form elements (one of the most common), user interaction (drag and drop in a browser window, insert new form elements like textboxes for adding new records to a table), user notification (Facebook notifications), asynchronously retrieving data from a server and loading it into the page (AJAX), or a long list of other possible operations. To list every feature of what JavaScript could be used for here would be a heroic effort.
Since it is a prototype language, one can write C style programs in JavaScript.
Since it is a functional language, one can write Lisp style programs in JavaScript.
If you've had any formal training in Computer Science then those two languages may be familiar to you. The majority of computer programs are written in either of those two styles. Since JavaScript allows a developer to write in the style with which he is the most fluent, this can be shown to be a boon as the developer is able to start writing code faster on introduction to the language.
I have seen full fledged games replete with complicated graphics written in JavaScript. I have also seen rudimentary video players (relying on HTML5) with some basic manipulation functionality written in JavaScript.
However, JavaScript being most often used in web applications, it's important to remember that JavaScript is used as a client-side language. It does not affect operations on the server. It can be bypassed. Do not rely on JavaScript to do EVERYTHING for your application.
Hopefully this helps and gives you some guidance and answers your question?

- 15,889
- 12
- 75
- 121
In web development there are 3 main components: HTML, CSS, and Javascript.
HTML is for holding the data, the content, the structure of your webpage or webapp.
CSS is for the style, layout, and visual look of your webpage or webapp.
And Javascript is (often) for the dynamic or reactive aspects of your webpage or web app: animations, form validation, ajax, and so forth.

- 686
- 5
- 11
You can use javascript to make your pages more interactive. You can check stuff before sending it server and save time for the user. You can create a lot of interesting stuff with that... there are many web applications relying on javascript as their main engine.

- 5,222
- 2
- 28
- 26
You can use Javascript to development client side "things" in your application. This saves you from going back to the server, which is good for: lower band usage, lower server strength usage and better client user experience. A popular framework is jquery.

- 1,004
- 2
- 12
- 24
It's a scripting language that can be used to build dynamic pages but most importantly, it shifts some of the computational effort of running these applications from the server to the client machine.
JavaScript is pretty powerful, so it would be difficult to list everything that can be done with it. I wouldn't know what Web 2.0 would look like without it.
JavaScript is becoming very mainstream these days. There has been a lot of effort put in by Google to make Javascript fast in the V8 JavaScript Engine. Which has led to a lot of interest in serverside JavaScript use.
NodeJs is a good example of a server-side application that is now growing in popularity with a lot of promise in use cases where asynchronous and functional programming makes sense (like networking applications).
Other applications like PhantomJs a headless browser based on WebKit are natural choices when building javascript testing applications or automatic web-scrapers. (CasperJs is a great example of a project built on top of PhantomJs).
JavaScript is conceptually more difficult than other languages people come across because it is prototypical as well as functional. Although it is possible to design applications using some of the standard patterns that have been built over the years, there are many ways to implement the exact same patterns and there is no standardization of best practice or consenses on the best way to implement these design.
There are now many tools that CofeeScript and TypeScript that help close that gap by allowing developers to code in an object oriented language that compiles to a standard object oriented subset of JavaScript.

- 32,179
- 12
- 66
- 85
-
1I thought the face of Web2.0 was pretty much defined by the use of JavaScript ... (not the XML, RSS, etc, just the FACE of Web2.0 due to the interactivity layer) – jcolebrand Aug 16 '10 at 21:11
JavaScript is a language that is executed by web browsers and is often used to make dynamic web pages. A simple example would be if you wish to perform some simple calculations (such as shipping costs) on values that a user puts in a form. You could make the user posts data to the server every time they want an answer, or you could have a button the execute a JavaScript calculation and display the answer to the user. There are more complex examples, of course. AJAX is a currently popular application of JavaScript.

- 26,726
- 31
- 139
- 202
Javascript is mostly used to make webpage dynamic and interactive. I typically runs in the browser but there are Server Side implementations

- 132,095
- 25
- 206
- 225
java-script is used in a browser for many uses, used mostly on user side or client side , for example in a form consider a text-box where you need to input a integer but you have entered some string instead of that in that case it notifies the user to enter the valid information like a popup or something, this is just an example but java script is used for many purposes.

- 3
- 5
Javascript is used to make a webpage dynamic/Interactive it can be used to validate fields, access and modify DOM such as change HTML attributes, contents, styles It is also used for Ajax

- 1
- 1