1 Introduction Flow Control
1 Introduction Flow Control
- Javascript
---------------------------
Javascript - Scripting Language - to perform validation on client side
</script>
inside head section or body section
-----------------------------------------
<html>
<head>
<title> Javascript </title>
</head>
<body>
<script type="text/javascript">
document.write("Welcome to Javascript");
</script>
</body>
</html>
-------------------------------------------
-scripting language -
- follows OOPS concept
- DOM model
DOM ? Document Object Model -
document-(predefined Object)
- write() - method - to print the message to the browser
objectname.methodname(); -- c++ syntax
-----------------------------
Variable ?
name - which holds some value
var variablename = value;
var a=10;
var b=20.3;
var c="Jigarthanda";
so it is called loosely type language
---------------------------------
int a=10;
float b=20.3; -- strict type language
---------------------------------
operator?
symbol - performs operation
- Arithmetic operator
- Relational operator
- Logical operator
----------------------------
Conditional Statement -
if
if-else
switch-case
-------------------------
Looping statement
for
while
do-while
-----------------------------
Function - set of statement - which performs - some task
function functioname()
{
}
function functioname(pararmeter1,parameter2)
{