Question

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.

Was it helpful?

Solution

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

OTHER TIPS

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.

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

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?

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.

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.

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.

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.

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

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.

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

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.

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top