views:

253

answers:

11

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.

+1  A: 

Javascript is mostly used to make webpage dynamic and interactive. I typically runs in the browser but there are Server Side implementations

SQLMenace
+5  A: 

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.

Justin Niessner
Don't forget Adobe! *(Although sometimes they piss me off.)*
ChaosPandion
+4  A: 

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).

Crayon Violent
+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
+2  A: 

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.

devmake
+2  A: 

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.

Roger
+2  A: 

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.

DKinzer
I 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)
drachenstern
Yeah, that's for sure.
DKinzer
+4  A: 

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.)

Jay
+1  A: 

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.

FrustratedWithFormsDesigner
+3  A: 

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?

drachenstern
+2  A: 

Nowadays JavaScript is for killing desktop applications!!!
For example ExtJs is perfect library for it.

Zango
+1  A: 

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.

edtechdev
@edtechdev how javascripts and ajax are related. How to connect these two.
Gladiator