Javascript is also abbreviated as JS, which is one of the most popular and widely used client-side scripting language in the world. In this tutorial, I’ll explain all about Javascript which we use in day-to-day web development.
Javascript Key Points: What is Javascript?
1. JavaScript is a scripting language that allows you to add real programming within your HTML document or webpage.
2. JavaScript is a client-side scripting language.
3. JavaScript is a lightweight programming language.
4. JavaScript is easy to learn and implement within your webpage.
5. JavaScript can be updated and changed from HTML and CSS files.
6. JavaScript can also use to validate html form data.
jQuery Usage and Example
JavaScript code is mostly implemented under HTML <script> tag within web page to execute and instruct all types of web browsers.
JavaScript code is written into an HTML page. When a user requests an HTML page with JavaScript in it, the script is sent to the browser and it’s up to the browser to do something with it.
JavaScript is normally used to validate login, signup, validate web form on client side, opening pages in customized windows, to get web browser viewport’s height and width, storing information on the visitor’s computer and then retrieving this information automatically next time the user visits your page etc.
Sample Code
Following is the basic example code that is designed for you to get started using JavaScript:
<html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>What is Javascript?</title> <script type="text/javascript"> //assigning value '10' to Javascript variable 'noOfCount' var noOfCount = 10; //Writing a noOfCount value on webpage document.write("OUTPUT:<br />"); document.write("=========<br />"); document.write("Value of noOfCount = " + noOfCount); </script> </head> <body> <br /> <br /> Othe visible page content in body </body> </html>
Sample Result
=========
Value of noOfCount = 10Other visible page content in body