0% found this document useful (0 votes)
6 views

CSS Notes CH 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

CSS Notes CH 1

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

CLIENT SIDE SCRIPTING LANGUAGE

CODE-22519
Examination Scheme
Theory-100
Practical-50
COURSE OUTCOMES(COs)
a) Create interactive web pages using program flow control structure.
b) Implement arrays and functions in javascript.
c) Create event based web forms using javascript.
d) Use javascript for handling cookies.
e) create interactive webpages using regiular expressions for validations.
f) Create menus and navigations in web pages
Unit-1 Basics of Javascript Programming
Total-12 Marks

• 1.1 Features of Javascript


Lightweight and Interpreted
Open and Cross-Platform
Event Handling
Case Sensitive
Unit-1 Basics of Javascript Programming

• 1.2 Object Name


Object name is nothing but the list of property.
Example: const person={ };
Explanation: where,
const=Data type whose value remains constant.
person=Object Name
{ }=having list of properties.
Unit-1 Basics of Javascript Programming

• Property
Detailing regarding Object .
Example: const person={first_name:”John”};
Explanation: where,
const=Data type whose value remains constant.
person=Object Name
{ }=having list of properties.
first_name=variable name
john=value
Unit-1 Basics of Javascript Programming
• Method
To use and manipulate data which is stored in object.
works like functions.
Example: object.assign(target,source)
Explanation:where,
object=keyword
. =operator to assign values
assign=keyword to assign data
target= object name in which we want to add
properties.
source=object name from which we want to add
Unit-1 Basics of Javascript Programming

• Dot syntax:
To access the properties in Javascript.
Example:var cat={name:julie,age:5};
Explanation:where,
var= datatype
cat= object name
name,age= properties of object
julie, 5= values of properties
Unit-1 Basics of Javascript Programming

• Main Event:
Also called as actions.
Example:
 onclick
 onmouseover
 onmouseout
 onchange
 onsubmit
Unit-1 Basics of Javascript Programming

• 1.3 Values and Variables


Used to store the data.
Example: var x=5;
Explanation: where,
var=datatype
x= variable
5= value
Unit-1 Basics of Javascript Programming

• 1.4 Operators:
Arithmetic operators: +, -, *, /, %, ++, --
Assignment operators: =, +=, -=, *=, /=
Comparison operator: ==, !=, >, <, >=, <=
Conditional operator: (condition)?x:y
Logical operators: &&, ||, !
Unit-1 Basics of Javascript Programming

• Expression:
Primary Expressions: Combination of variables,values,operators.
Example: 5*10
Object and Array intializers:
Example: sports=[‘cricket’, ‘football’, ‘hockey’]
Function definition expression:
function fun_name(parameters)
{

}
Unit-1 Basics of Javascript Programming

• Property access expression:


Example:value.x
value[x]
• Invocation Expression:
Calling or executing function.
Example:
f(0)
math.max(x,y,z)
a.sort
Unit-1 Basics of Javascript Programming

• 1.5 If statement
if(condition)
{
}
if(condition)
{
}
else{
}
Unit-1 Basics of Javascript Programming

if(condition1){
}
elseif(condition2)
{
}
else{
}
Unit-1 Basics of Javascript Programming
• 1.6 Switch case statement:
Syntax: switch(expression){
case x:
//code
break;
case y:
//code
break;
default:
//code block
}
Unit-1 Basics of Javascript Programming

• 1.7 Loop statement:


To run the same part of code multiple time with different value.
for loop:
Example: for(let i=0; i<5; i++){
text+= “Number is”+ i+ “<br>”;}
while loop:
Example:let i=0;
while(i<5){
text+= “Number is”+ i+ “<br>”;
i++; }
Unit-1 Basics of Javascript Programming

continue statement:
Loop through a block of code, but skip the value of specified number.
Example: let text= “ ”;
for(let i=0; i<5; i++)
{
if(i==3){
continue;
text+= i+ “<br>”;
}
Unit-1 Basics of Javascript Programming

• 1.8 Querying and setting properties & deleting properties


Querying:
var author= book.author;
Settting:
book.edition=5;
Deleting:
delete book.author;
Unit-1 Basics of Javascript Programming

• Property getters and setters:


Example:
const person= {f_name: “john”, l_name: “ ”, language: “en”,
get lang(){
return this.language;
}
set name(“Doe”){
return this.l_name;
}
};

You might also like