Java Script Learning

Java Script Learning : 

JavaScript is a scripting language of the Web.
All modern HTML pages are using JavaScript to add functionality, validate input, communicate with web servers, and much more. JavaScript is easy to learn. You will enjoy it.
  
JavaScript is a Scripting Language :
 
A scripting language is a lightweight programming language.
JavaScript is programming code that can be inserted into HTML pages.
JavaScript inserted into HTML pages, can be executed by all modern web browsers.
JavaScript is easy to learn.

 JavaScript Functions and Events :
 
The JavaScript statements, in the example above, are executed while the page loads.
More often, we want to execute code when an event occurs, like when the user clicks a button.
If we put JavaScript code inside a function, we can call that function when an event occurs.
You will learn much more about JavaScript functions and events in later chapters.

JavaScript in <head> or <body> :

You can place an unlimited number of scripts in an HTML document.
Scripts can be in the <body> or in the <head> section of HTML, and/or in both.
It is a common practice to put functions in the <head> section, or at the bottom of the page. This way they are all in one place and do not interfere with page content.

A JavaScript Function in <head>:

In this example, a JavaScript function is placed in the <head> section of an HTML page.
The function is called when a button is clicked:


No comments:

Post a Comment