SlideShare una empresa de Scribd logo
1 de 5
INTRODUCTION OF JAVASCRIPT




What is JavaScript?

JavaScript (sometimes abbreviated JS) is a prototype-based scripting language that
is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language,
supporting object-oriented, imperative, and functional programming styles. JavaScript is
an implementation of the ECMAScript language standard and is typically used to enable
programmatic access to computational objects within a host environment. JavaScript is a
programming language used to make web pages interactive. It runs on your visitor's
computer and doesn't require constant downloads from your website. JavaScript is often
used to create polls and quizzes. It is the standard language used in web pages, but it is
also widely used by desktop apps, mobile phone apps, and internet servers.

Why we use JavaScript?

JavaScript is not specifically HTML related, but interacts with HTML and DHTML when
used in a browser. It's a more traditional programming language, in that you can write a
series of instructions to compute what kinds of actions should be taken based on various
conditions, repeat things a variable number of times, and just generally take more complex
and sophisticated actions. Small applications and games have been written entirely in
JavaScript.


The line between DHTML and JavaScript can sometimes get blurry, but a rule of thumb I
use is simple: DHTML is about the web page, period. The items on a web page, the events
that a web page might want to act on (like moving your mouse over text), and the resulting
changes to the web page that you might want to have happen resulting from those events
(like changing the color of text). JavaScript, however, is really web, and HTML,
independent. It adds programming things like loops, and variables and functions. You could
write a small program to calculate Pi in JavaScript, and then perhaps use DHTML to do
something interesting on the web page with it.
What is the purpose of JavaScript?

Functions allow us to remove these statements from all of the places that they are needed
and define them just once. We then “call” the function from each of the places where we
need those statements to run. This makes maintaining the code easier as we only have one
place where the particular series of statements occurs rather than repetitions of the
same code. Any changes to that one block will automatically apply to each place where the
function is called.Using functions also allows us to modularize our approach to writing the
code. This means that we can break up the processing into sections and not concern
ourselves with how all of the processing needs to work all at the same time. When we are
coding the function we need only concern ourselves with how the function needs to be
coded in order to perform its intended task.


JavaScript program:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>zoya</title>

<script type="text/javascript">

functionabc()

{

         var a=document.getElementById('un').value;




                if(a=="")

    {

alert("Must be enter name");
return false;

 }

       var p=document.getElementById('pwd').value;

       if(p=="")

       {

                alert("must enter pasword");

                return false;

                }

       if(p.length<8)

       {

                alert("password too Short");

                return false;

                }

       if(p.length>=14)

       {

                alert("password too long");

                return false;

                }

       var e=document.getElementById('em').value;

       em.indexof("@")

       if(e==-1)

       {

       alert("must enter @");
return false;

         }

         em.indexof(".")

         if(e==-1)

         {

         alert("must enter .");

         return false;

         }



}

</script>

</head>




<body>




<form>

Username:

<input type="text" name="uname" id="un"/>

<br/>

<br/>

Password:

<input type="password" id="pwd"/>

<br/>
<br/>

E-mail:

<input type="text" name="mal" id="em"/>

<br/>

<br/>



<input type="submit" value="login" onclick="return abc()" />

</form>

</body>

</html>

Más contenido relacionado

La actualidad más candente

Intro to java script
Intro to java scriptIntro to java script
Intro to java script
londiem
 

La actualidad más candente (19)

JavaScript Introduction
JavaScript IntroductionJavaScript Introduction
JavaScript Introduction
 
Java Script An Introduction By HWA
Java Script An Introduction By HWAJava Script An Introduction By HWA
Java Script An Introduction By HWA
 
Java Script
Java ScriptJava Script
Java Script
 
HTML Introduction
HTML IntroductionHTML Introduction
HTML Introduction
 
Java script
Java scriptJava script
Java script
 
Scripting languages
Scripting languagesScripting languages
Scripting languages
 
Java script programs
Java script programsJava script programs
Java script programs
 
Javascript by geetanjali
Javascript by geetanjaliJavascript by geetanjali
Javascript by geetanjali
 
Javascript tutorial
Javascript tutorialJavascript tutorial
Javascript tutorial
 
Javascripts. pptt
Javascripts. ppttJavascripts. pptt
Javascripts. pptt
 
Java script
Java scriptJava script
Java script
 
Introduction to html & css
Introduction to html & cssIntroduction to html & css
Introduction to html & css
 
Introduction to java_script
Introduction to java_scriptIntroduction to java_script
Introduction to java_script
 
Intro to java script
Intro to java scriptIntro to java script
Intro to java script
 
JavaScript Missing Manual, Ch. 1
JavaScript Missing Manual, Ch. 1JavaScript Missing Manual, Ch. 1
JavaScript Missing Manual, Ch. 1
 
Javascript
JavascriptJavascript
Javascript
 
JAVA SCRIPT
JAVA SCRIPTJAVA SCRIPT
JAVA SCRIPT
 
Java scipt
Java sciptJava scipt
Java scipt
 
Java script
Java scriptJava script
Java script
 

Destacado (6)

Sony nextep
Sony nextepSony nextep
Sony nextep
 
Ozon
OzonOzon
Ozon
 
Mobile phone calling and texting college students in pakistan
Mobile phone calling and texting college students in pakistanMobile phone calling and texting college students in pakistan
Mobile phone calling and texting college students in pakistan
 
Android vs window
Android vs windowAndroid vs window
Android vs window
 
Maslow, herzberg, mc clelland, ouchi, thamhain and wilemon and convey theories
Maslow, herzberg, mc clelland, ouchi, thamhain and wilemon and convey theoriesMaslow, herzberg, mc clelland, ouchi, thamhain and wilemon and convey theories
Maslow, herzberg, mc clelland, ouchi, thamhain and wilemon and convey theories
 
Game playing in artificial intelligent technique
Game playing in artificial intelligent technique Game playing in artificial intelligent technique
Game playing in artificial intelligent technique
 

Similar a Introduction of javascript

Basics java scripts
Basics java scriptsBasics java scripts
Basics java scripts
ch samaram
 
Java Script - A New Look
Java Script - A New LookJava Script - A New Look
Java Script - A New Look
rumsan
 
Jscript Fundamentals
Jscript FundamentalsJscript Fundamentals
Jscript Fundamentals
rspaike
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3
tutorialsruby
 
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
tutorialsruby
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3
tutorialsruby
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
tutorialsruby
 
JavaScript and jQuery Fundamentals
JavaScript and jQuery FundamentalsJavaScript and jQuery Fundamentals
JavaScript and jQuery Fundamentals
BG Java EE Course
 

Similar a Introduction of javascript (20)

Wt unit 2 ppts client sied technology
Wt unit 2 ppts client sied technologyWt unit 2 ppts client sied technology
Wt unit 2 ppts client sied technology
 
Wt unit 2 ppts client side technology
Wt unit 2 ppts client side technologyWt unit 2 ppts client side technology
Wt unit 2 ppts client side technology
 
Introduction to java script
Introduction to java scriptIntroduction to java script
Introduction to java script
 
Basics java scripts
Basics java scriptsBasics java scripts
Basics java scripts
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
 
Introduction to JavaScript Basics.
Introduction to JavaScript Basics.Introduction to JavaScript Basics.
Introduction to JavaScript Basics.
 
Unit 2.4
Unit 2.4Unit 2.4
Unit 2.4
 
Unit 2.4
Unit 2.4Unit 2.4
Unit 2.4
 
Java Script - A New Look
Java Script - A New LookJava Script - A New Look
Java Script - A New Look
 
Jscript Fundamentals
Jscript FundamentalsJscript Fundamentals
Jscript Fundamentals
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3
 
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
&lt;b>PHP&lt;/b>/MySQL &lt;b>Tutorial&lt;/b> webmonkey/programming/
 
php-mysql-tutorial-part-3
php-mysql-tutorial-part-3php-mysql-tutorial-part-3
php-mysql-tutorial-part-3
 
&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />&lt;img src="../i/r_14.png" />
&lt;img src="../i/r_14.png" />
 
JavaScript and jQuery Fundamentals
JavaScript and jQuery FundamentalsJavaScript and jQuery Fundamentals
JavaScript and jQuery Fundamentals
 
Javascript
JavascriptJavascript
Javascript
 
Html javascript
Html javascriptHtml javascript
Html javascript
 
FYBSC IT Web Programming Unit III Javascript
FYBSC IT Web Programming Unit III JavascriptFYBSC IT Web Programming Unit III Javascript
FYBSC IT Web Programming Unit III Javascript
 
An introduction to DOM , JAVASCRIPT , JQUERY, AJAX and JSON
An introduction to DOM , JAVASCRIPT , JQUERY, AJAX and JSONAn introduction to DOM , JAVASCRIPT , JQUERY, AJAX and JSON
An introduction to DOM , JAVASCRIPT , JQUERY, AJAX and JSON
 
Pascarello_Investigating JavaScript and Ajax Security
Pascarello_Investigating JavaScript and Ajax SecurityPascarello_Investigating JavaScript and Ajax Security
Pascarello_Investigating JavaScript and Ajax Security
 

Último

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Último (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 

Introduction of javascript

  • 1. INTRODUCTION OF JAVASCRIPT What is JavaScript? JavaScript (sometimes abbreviated JS) is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles. JavaScript is an implementation of the ECMAScript language standard and is typically used to enable programmatic access to computational objects within a host environment. JavaScript is a programming language used to make web pages interactive. It runs on your visitor's computer and doesn't require constant downloads from your website. JavaScript is often used to create polls and quizzes. It is the standard language used in web pages, but it is also widely used by desktop apps, mobile phone apps, and internet servers. Why we use JavaScript? JavaScript is not specifically HTML related, but interacts with HTML and DHTML when used in a browser. It's a more traditional programming language, in that you can write a series of instructions to compute what kinds of actions should be taken based on various conditions, repeat things a variable number of times, and just generally take more complex and sophisticated actions. Small applications and games have been written entirely in JavaScript. The line between DHTML and JavaScript can sometimes get blurry, but a rule of thumb I use is simple: DHTML is about the web page, period. The items on a web page, the events that a web page might want to act on (like moving your mouse over text), and the resulting changes to the web page that you might want to have happen resulting from those events (like changing the color of text). JavaScript, however, is really web, and HTML, independent. It adds programming things like loops, and variables and functions. You could write a small program to calculate Pi in JavaScript, and then perhaps use DHTML to do something interesting on the web page with it.
  • 2. What is the purpose of JavaScript? Functions allow us to remove these statements from all of the places that they are needed and define them just once. We then “call” the function from each of the places where we need those statements to run. This makes maintaining the code easier as we only have one place where the particular series of statements occurs rather than repetitions of the same code. Any changes to that one block will automatically apply to each place where the function is called.Using functions also allows us to modularize our approach to writing the code. This means that we can break up the processing into sections and not concern ourselves with how all of the processing needs to work all at the same time. When we are coding the function we need only concern ourselves with how the function needs to be coded in order to perform its intended task. JavaScript program: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>zoya</title> <script type="text/javascript"> functionabc() { var a=document.getElementById('un').value; if(a=="") { alert("Must be enter name");
  • 3. return false; } var p=document.getElementById('pwd').value; if(p=="") { alert("must enter pasword"); return false; } if(p.length<8) { alert("password too Short"); return false; } if(p.length>=14) { alert("password too long"); return false; } var e=document.getElementById('em').value; em.indexof("@") if(e==-1) { alert("must enter @");
  • 4. return false; } em.indexof(".") if(e==-1) { alert("must enter ."); return false; } } </script> </head> <body> <form> Username: <input type="text" name="uname" id="un"/> <br/> <br/> Password: <input type="password" id="pwd"/> <br/>
  • 5. <br/> E-mail: <input type="text" name="mal" id="em"/> <br/> <br/> <input type="submit" value="login" onclick="return abc()" /> </form> </body> </html>