Wednesday, August 3, 2011

LEARNING JAVASCRIPT - WIKIBOOKS

Source: http://en.wikibooks.org/wiki/JavaScript/Introduction

My method: Highlighting the lines I feel are important and must be read. Infact note them down and you'll make your notes out of it.

Welcome

Introduction

JavaScript is an interpreted programming language that is mostly used to turn static web pages into dynamic and interactive pages after a web browser has finished downloading a web page. For example, a clock displayed on a page that updates itself to show the current time on the user's computer. JavaScript's design was influenced by many programming languages, including C, but is meant to be more usable by non-programmers. JavaScript is not based on or related to Java; this is a common misunderstanding.

JavaScript is often included inside an HTML file or linked to from an HTML file and run locally by a web browser. This means that servers are free to work on something else rather than processing instructions for each client. This has made JavaScript a more popular choice than languages that require a server to do the processing.

Some example uses are:

  • rotating or scrolling text.
  • making portions of a form visible or invisible. For example in an order form, if the user ticks a checkbox "deliver to different address", an extra section with text boxes with delivery streetname, number, and place may be made visible.
  • drop down menus.
  • retrieving extra information from the server (Ajax) to partially refresh a page.
  • validate user input on a form.
  • computations without the need to go back to the server.
  • determine browser-type.
  • obscure some information from certain types of users, such as email addresses from bots.

Server-side languages such as PHP or Perl are the best way to modify a page before loading, although there are some cases of Server-JavaScript (SJS). Not all browsers have a JavaScript interpreter (such as the text-only browser Lynx), or run its latest version. Furthermore, some users turn off JavaScript capabilities by choice. Generally, web pages should use JavaScript to enhance the user's experience, rather than depend on it. This is often referred to as graceful degradation (i.e if the user has turned off JavaScript, the page should always still load, presenting the same information but without the extra functionality provided by JavaScript.)

No comments:

Post a Comment