JS Introduction Variables Js Versions Tags JS Variables and Naming Rules
in this tutorial we will briefly talk on JS Introduction Variables Js Versions Tags JS Variables and Naming Rules
Consider an online shopping website where a customer can add or remove products from cart further can add on an interested list and at the end a customer can buy online products by providing credit card information.to handle all these task web developers need to handle all task dynamically like credit card number email and phone number entered by the customer must be in proper and valid format and also chosen products and their quantity to calculate the total cost.
Scripting refers to a series of commands that are interpreted and executed sequentially. This action event generated by a user interacting with a Web page, for example, an event occurs when a button is clicked or user selected products from the list.
Two type scripting language there and they are…
Client-side scripting languages executed on user’s machine by the browsers.
Server-side scripting language executed on a web server to generate dynamic HTML pages.
|1.1||Is supported from 3.0 version of the Netscape Navigator and Internet Explorer|
|1.2||Is supported by the Internet Explorer from version 4.0|
|1.3||Is supported by the Internet Explorer from version 5.0 Netscape Navigator from version 4.0 and Opera from version 5.0|
|1.4||Is supported by servers of Netscape and Opera 6|
|1.5||Is supported by the Internet Explorer from version 6.0 Netscape Navigator from version 6.0 and Mozilla Firefox from version 1.0|
|1.6||Is supported in the latest versions of the Internet Explorer and Netscape Navigator browsers. It is also supported by Mozilla Firefox from version 1.5|
|1.7||Is supported in the latest versions of the Internet Explorer and Netscape Navigator browsers. It is also supported by Mozilla Firefox from version 2.0|
Variable is a container to hold a value and store in a memory at a unique location in RAM for the example student name age roll number salary of an employ etc.
Declaring a Variable refer to creating a variable by specifying the variable name.To store a student name you can create the stuName variable. Here stuName is an identifier
var is the keyword to allocate memory for variable.
variableName Is a valid variable name.
Variable Naming Rules
- Should be consist on digits, underscore, and alphabets.
- Must begin with a letter or the underscore character.
- Cannot begin with a number and cannot contain any punctuation marks.
- Cannot contain any kind of special characters such as +, *, %, and so on.
- Cannot contain spaces.