JavaScript is THE scripting language of the Web.
JavaScript is used in millions of Web pages to add functionality, validate forms, detect browsers, and much more.
Mining Engineers Dairy - Metalliferous Mines India Sarla Nair India (Copper Mining Family)
JavaScript is the most popular scripting language on the internet, and works in all major browsers, such as Internet Explorer, Firefox, Chrome, Opera, and Safari. What is JavaScript?
<body> <script type="text/javascript"> document.write("This is my first JavaScript!"); </script> </body> </html> The example below shows how to add HTML tags to the JavaScript: <html> <body> <script type="text/javascript"> document.write("<h1>Hello World!</h1>"); </script> </body> </html> JavaScript is Case SensitiveUnlike HTML, JavaScript is case sensitive - therefore watch your capitalization closely when you write JavaScript statements, create or call variables, objects and functions. JavaScript StatementsA JavaScript statement is a command to a browser. The purpose of the command is to tell the browser what to do. JavaScript CodeJavaScript code (or just JavaScript) is a sequence of JavaScript statements. Each statement is executed by the browser in the sequence they are written. | What can a JavaScript do?
JavaScript BlocksJavaScript statements can be grouped together in blocks. Blocks start with a left curly bracket {, and ends with a right curly bracket }. The purpose of a block is to make the sequence of statements execute together. JavaScript CommentsComments can be added to explain the JavaScript, or to make the code more readable. Single line comments start with //. JavaScript Multi-Line CommentsMulti line comments start with /* and end with */. | The Real Name is ECMAScriptJavaScript's official name is ECMAScript. ECMAScript is developed and maintained by the ECMA organization. ECMA-262 is the official JavaScript standard. The language was invented by Brendan Eich at Netscape (with Navigator 2.0), and has appeared in all Netscape and Microsoft browsers since 1996. The development of ECMA-262 started in 1996, and the first edition of was adopted by the ECMA General Assembly in June 1997. The standard was approved as an international ISO (ISO/IEC 16262) standard in 1998. The development of the standard is still in progress. Where to Put the JavaScriptJavaScripts in a page will be executed immediately while the page loads into the browser. This is not always what we want. Sometimes we want to execute a script when a page loads, other times when a user triggers an event. Scripts in <head>Scripts to be executed when they are called, or when an event is triggered, go in the head section. If you place a script in the head section, you will ensure that the script is loaded before anyone uses it. JavaScript VariablesAs with algebra, JavaScript variables are used to hold values or expressions. A variable can have a short name, like x, or a more descriptive name, like carname. Rules for JavaScript variable names:
|