0% found this document useful (0 votes)
1K views

Javascript TCS Xplore

JavaScript is an object-oriented scripting language used to make web pages interactive. It was introduced by Netscape as JavaScript and is now an implementation of ECMAScript. JavaScript code can be added to HTML pages within <script> tags or in separate .js files. It allows for dynamic updating of web page content without reloading the page. Common data types in JavaScript include numbers, strings, Booleans, objects and arrays. Core operators include arithmetic, comparison, logical and assignment operators. The DOM (Document Object Model) represents an HTML document and is used to dynamically access and update elements.

Uploaded by

Lafhanga Ladka
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1K views

Javascript TCS Xplore

JavaScript is an object-oriented scripting language used to make web pages interactive. It was introduced by Netscape as JavaScript and is now an implementation of ECMAScript. JavaScript code can be added to HTML pages within <script> tags or in separate .js files. It allows for dynamic updating of web page content without reloading the page. Common data types in JavaScript include numbers, strings, Booleans, objects and arrays. Core operators include arithmetic, comparison, logical and assignment operators. The DOM (Document Object Model) represents an HTML document and is used to dynamically access and update elements.

Uploaded by

Lafhanga Ladka
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

JAVASCRIPT 

 
Introductio :- 
 
● JavaScript is a Object-Oriented programming language used to create interactive
effects within web browsers.
● Introduced by netscape named as ECMAScript later called JavaScript.
● It is dynamic computer programming language.
● It is a lightweight,interpreted programming language.
● It is used to create dynamic web pages.
● It is the implementation of ECMAScript.
● It is a case sensitive language.

Advantage :- 
 
● Less server interaction.
● Immediate feedback to the visitors.
● Increased interactivity.
● Richer Interfaces.

Di -Advantage :- 
 
● Client side javascript does not allow reading or writing of files.
● Does not have multithreading and multiprocessor capabilities.
● Security issues.

Synt :- 
 
<html>
<head></head>
<body>

<script type=”text/javascript” src=”../JS/test.js”>


JSCODE

</script>
</body>
</html>
JavaScript code can be written in script tag or may have separate script file also.

Variabl :- 

Variable in javaScript represented by var keyword.


var x=100;
Global variable :- These are those variable which can be used anywhere.
Local variable :- It can be used inside function only.

Dat -T e i javascrip :- 

● Number. Eg :- 1,2,5.8 etc.


● String. Eg :- “Hello”,’Hello’.
● Boolean. Eg :- True or False.
● Custom Objects.
● Predefined Objects. Eg :- Regex,Date,DOM,Maths,JSON & Array.

Operator i Jav Scrip :- 


 
● Arithmetic Operators (+,-,*,/,%)
● Comparison Operators (==,!=,<,>,<=,>=)
● Logical & Relational Operators (&&,||)
● Assignment Operators (=,+=,-=)
● Conditional or ternary operators (?:)

Jav Scrip Strin Objec :- 


 
● CharAt()
● concat()
● trim()
● toUpperCase()
● toLowerCase()

Jav Scrip Array :- 


 
● concat()
● forEach()
● push()
● pop()
● reverse()
● sort()

Jav Scrip Regular pressio :- 


 
● JavaScript regular expression is an object that describes the pattern of
characters.

Var pattern=new RegExp(pattern);


Or
Var pattern=/pattern/
pattern.test(String); returns boolean.

Documen Objec Mode or DOM:- 


 
● The way, a document object is accessed or modified is called document object
model or DOM.
● Each HTML component that can be loaded into the window is called document
object model.The document has the content of the page.
● Window Object is the outermost element and it is on the top of the hierarchy of
the document model.
● Form object -Every element enclosed within <form></form> is called form object.
 

Jav Scrip Even an Even Listener:- 


 
● JavaSCript interaction with HTML is handled through events.

 
Jav Scrip Dialo _B e :- 
 
● alert(“text”);
● Boolean b=confirm(“Yes or No”);
● prompt(“Enter Username”);

DOM method :- 


 
● document.getElementById(“Id”);
● document.getElementByTagName(“input ”);
● document.getElementById(“divId”).InnerHTML=”messages”;
● document.getElementById(“divId”).value.

You might also like