SlideShare a Scribd company logo
Web Authoring

            Topic 21 –
Passing Information via Javascript
Objectives
Students should able to:
1 Pass information via web forms using
the submit button.
2. Identify and use the various JavaScript
     features:
      • Variables.
      • Custom and Build-in Functions
      • alert()
      • prompt()
What is Javascript?
JavaScript is a Web based programming
language. It can be used to create
dynamic Web pages.

A dynamic Web page changes its
appearance or the content depending on
the user input or the time.
Writing Javascript
A JavaScript program can be embedded
into our HTML code.

<HEAD>
    <TITLE>My JavaScript page</TITLE>
    <SCRIPT LANGUAGE= “text/JavaScript”>
    </SCRIPT>
</HEAD>
Writing Javascript
Some points to note about when writing
Javascript.

All JavaScript commands should come in
between the <SCRIPT> and </SCRIPT>
tags

All JavaScript commands should be
followed by a semicolon (;)
Using Alert
ALERT commands are messages, which
pop up in a new small window.
They automatically get closed when the
user clicks OK button.

Syntax of the ALERT command:
    <SCRIPT language = “text/JavaScript”>
        alert(“Hello world!”);
    </SCRIPT>
Using variable
We can use variables in JavaScript like
other programming languages
Use the var keyword to declare variables.
    var      secsPerMin = 60;

Variables must start with either a letter or
the underscore character.

Variable names are case-sensitive.
Using prompt command
The PROMPT command is used to get
information from the user.
Sample code:
   var a = prompt(“What is your name?”);
   var b = “Good Morning!” + a;
   alert (b);
Using math operations
We can use MATH operations to do
calculations on the variables.
Sample code:
var secsPerHour = 0;
secsPerHour = 24 * 60 * 60;

alert (“The number of seconds in an year =” +
           secsPerHour);
Displaying Text
If we want to display text on the Web
page, we can use the following
command:

    document.write(“The number of
seconds in an year=” +secs_per_year);
Date object
<SCRIPT LANGUAGE=”JavaScript”>
    var todayDate = new Date();
    document.write("Today's Date is ")
    document.write(todayDate.getDate());
    document.write(todayDate.getMonth());
    document.write(todayDate.getYear());
</SCRIPT>
Swapping Images
Using JavaScript you can change the
images when you place the mouse over
it.

This feature can be used to change
button images, decorate images and to
highlight the links.

More Related Content

What's hot

JavaScript Roadmap III - ECMAScript
JavaScript Roadmap III - ECMAScriptJavaScript Roadmap III - ECMAScript
JavaScript Roadmap III - ECMAScript
Aswin Barath
 
CodePreneur Week3 - Introduction to JavaScript
CodePreneur Week3 - Introduction to JavaScriptCodePreneur Week3 - Introduction to JavaScript
CodePreneur Week3 - Introduction to JavaScript
Oluwagbuyi Abimbola
 
JavaScript Missing Manual, Ch. 1
JavaScript Missing Manual, Ch. 1JavaScript Missing Manual, Ch. 1
JavaScript Missing Manual, Ch. 1
Gene Babon
 
Java script
Java scriptJava script
Java script
umesh patil
 
INFO 3775 Chapter 2 Part 1
INFO 3775 Chapter 2 Part 1INFO 3775 Chapter 2 Part 1
INFO 3775 Chapter 2 Part 1Jeff Byrnes
 
Css,javascript,php,mysql
Css,javascript,php,mysqlCss,javascript,php,mysql
Css,javascript,php,mysqlvurimi prasad
 
JavaScript with Syntax & Implementation
JavaScript with Syntax & ImplementationJavaScript with Syntax & Implementation
JavaScript with Syntax & Implementation
Soumen Santra
 
Ui automation
Ui automationUi automation
Ui automation
test test
 
Html5 events
Html5 eventsHtml5 events
Html5 events
AbhishekMondal42
 
Java script how to
Java script how toJava script how to
Java script how to
julian vega
 
Java script basic
Java script basicJava script basic
Java script basic
Vithushan Vinayagamoorthy
 
Type script = javascript (alomst) done right
Type script = javascript (alomst) done rightType script = javascript (alomst) done right
Type script = javascript (alomst) done right
Maurice De Beijer [MVP]
 
Java script by Act Academy
Java script by Act AcademyJava script by Act Academy
Java script by Act Academy
actanimation
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
Manaday Mavani
 
제 4회 DGMIT R&D 컨퍼런스 : Making a JavaScript based Application in Mac OS X
제 4회 DGMIT R&D 컨퍼런스 : Making a JavaScript based Application in Mac OS X제 4회 DGMIT R&D 컨퍼런스 : Making a JavaScript based Application in Mac OS X
제 4회 DGMIT R&D 컨퍼런스 : Making a JavaScript based Application in Mac OS X
dgmit2009
 
Working Software 2019 - TypeScript come (forse) non lo hai mai visto
Working Software 2019 - TypeScript come (forse) non lo hai mai vistoWorking Software 2019 - TypeScript come (forse) non lo hai mai visto
Working Software 2019 - TypeScript come (forse) non lo hai mai visto
Gianluca Carucci
 
KLab 2019 Meetup - TypeScript come (forse) non lo hai mai visto
KLab 2019 Meetup - TypeScript come (forse) non lo hai mai vistoKLab 2019 Meetup - TypeScript come (forse) non lo hai mai visto
KLab 2019 Meetup - TypeScript come (forse) non lo hai mai visto
Gianluca Carucci
 
Frameworks in JavaScript
Frameworks in JavaScriptFrameworks in JavaScript
Frameworks in JavaScript
Haim Michael
 
Javascript
JavascriptJavascript
Javascript
Mozxai
 

What's hot (20)

JavaScript Roadmap III - ECMAScript
JavaScript Roadmap III - ECMAScriptJavaScript Roadmap III - ECMAScript
JavaScript Roadmap III - ECMAScript
 
Basics
BasicsBasics
Basics
 
CodePreneur Week3 - Introduction to JavaScript
CodePreneur Week3 - Introduction to JavaScriptCodePreneur Week3 - Introduction to JavaScript
CodePreneur Week3 - Introduction to JavaScript
 
JavaScript Missing Manual, Ch. 1
JavaScript Missing Manual, Ch. 1JavaScript Missing Manual, Ch. 1
JavaScript Missing Manual, Ch. 1
 
Java script
Java scriptJava script
Java script
 
INFO 3775 Chapter 2 Part 1
INFO 3775 Chapter 2 Part 1INFO 3775 Chapter 2 Part 1
INFO 3775 Chapter 2 Part 1
 
Css,javascript,php,mysql
Css,javascript,php,mysqlCss,javascript,php,mysql
Css,javascript,php,mysql
 
JavaScript with Syntax & Implementation
JavaScript with Syntax & ImplementationJavaScript with Syntax & Implementation
JavaScript with Syntax & Implementation
 
Ui automation
Ui automationUi automation
Ui automation
 
Html5 events
Html5 eventsHtml5 events
Html5 events
 
Java script how to
Java script how toJava script how to
Java script how to
 
Java script basic
Java script basicJava script basic
Java script basic
 
Type script = javascript (alomst) done right
Type script = javascript (alomst) done rightType script = javascript (alomst) done right
Type script = javascript (alomst) done right
 
Java script by Act Academy
Java script by Act AcademyJava script by Act Academy
Java script by Act Academy
 
AngularJS Basics
AngularJS BasicsAngularJS Basics
AngularJS Basics
 
제 4회 DGMIT R&D 컨퍼런스 : Making a JavaScript based Application in Mac OS X
제 4회 DGMIT R&D 컨퍼런스 : Making a JavaScript based Application in Mac OS X제 4회 DGMIT R&D 컨퍼런스 : Making a JavaScript based Application in Mac OS X
제 4회 DGMIT R&D 컨퍼런스 : Making a JavaScript based Application in Mac OS X
 
Working Software 2019 - TypeScript come (forse) non lo hai mai visto
Working Software 2019 - TypeScript come (forse) non lo hai mai vistoWorking Software 2019 - TypeScript come (forse) non lo hai mai visto
Working Software 2019 - TypeScript come (forse) non lo hai mai visto
 
KLab 2019 Meetup - TypeScript come (forse) non lo hai mai visto
KLab 2019 Meetup - TypeScript come (forse) non lo hai mai vistoKLab 2019 Meetup - TypeScript come (forse) non lo hai mai visto
KLab 2019 Meetup - TypeScript come (forse) non lo hai mai visto
 
Frameworks in JavaScript
Frameworks in JavaScriptFrameworks in JavaScript
Frameworks in JavaScript
 
Javascript
JavascriptJavascript
Javascript
 

Viewers also liked

Web topic 22 validation on web forms
Web topic 22  validation on web formsWeb topic 22  validation on web forms
Web topic 22 validation on web formsCK Yang
 
Web topic 18 conflict resolution in css
Web topic 18  conflict resolution in cssWeb topic 18  conflict resolution in css
Web topic 18 conflict resolution in cssCK Yang
 
Web topic 17 font family in css
Web topic 17  font family in cssWeb topic 17  font family in css
Web topic 17 font family in cssCK Yang
 
Web topic 20 1 html forms
Web topic 20 1  html formsWeb topic 20 1  html forms
Web topic 20 1 html formsCK Yang
 
Web topic 15 2 basic css layout
Web topic 15 2  basic css layoutWeb topic 15 2  basic css layout
Web topic 15 2 basic css layoutCK Yang
 
Web topic 16 css workflow
Web topic 16  css workflowWeb topic 16  css workflow
Web topic 16 css workflowCK Yang
 
Web topic 20 2 html forms
Web topic 20 2  html formsWeb topic 20 2  html forms
Web topic 20 2 html formsCK Yang
 
Web topic 23 web accessibility
Web topic 23  web accessibilityWeb topic 23  web accessibility
Web topic 23 web accessibilityCK Yang
 
Web topic 25 mobile optimized website
Web topic 25  mobile optimized websiteWeb topic 25  mobile optimized website
Web topic 25 mobile optimized websiteCK Yang
 
Web topic 28. w3 c standards and guidelines
Web topic 28. w3 c standards and guidelinesWeb topic 28. w3 c standards and guidelines
Web topic 28. w3 c standards and guidelinesCK Yang
 
Web topic 14 cascading style sheets
Web topic 14  cascading style sheetsWeb topic 14  cascading style sheets
Web topic 14 cascading style sheetsCK Yang
 
Web topic 24 usage of web browser
Web topic 24  usage of web browserWeb topic 24  usage of web browser
Web topic 24 usage of web browserCK Yang
 
Web topic 29 w3 c page validation
Web topic 29  w3 c page validationWeb topic 29  w3 c page validation
Web topic 29 w3 c page validationCK Yang
 
Web topic 32 validate web contents
Web topic 32  validate web contentsWeb topic 32  validate web contents
Web topic 32 validate web contentsCK Yang
 
Web topic 30 ensure web contents meet
Web topic 30   ensure web contents meetWeb topic 30   ensure web contents meet
Web topic 30 ensure web contents meetCK Yang
 
Web topic 29 w3 c page validation
Web topic 29  w3 c page validationWeb topic 29  w3 c page validation
Web topic 29 w3 c page validationCK Yang
 
Web topic 15 1 basic css layout
Web topic 15 1  basic css layoutWeb topic 15 1  basic css layout
Web topic 15 1 basic css layoutCK Yang
 
Web topic 26 browser compatibilty and security
Web topic 26  browser compatibilty and securityWeb topic 26  browser compatibilty and security
Web topic 26 browser compatibilty and securityCK Yang
 
Web topic 31 setup remote site
Web topic 31  setup remote siteWeb topic 31  setup remote site
Web topic 31 setup remote siteCK Yang
 
Web topic 27 class test
Web topic 27  class testWeb topic 27  class test
Web topic 27 class testCK Yang
 

Viewers also liked (20)

Web topic 22 validation on web forms
Web topic 22  validation on web formsWeb topic 22  validation on web forms
Web topic 22 validation on web forms
 
Web topic 18 conflict resolution in css
Web topic 18  conflict resolution in cssWeb topic 18  conflict resolution in css
Web topic 18 conflict resolution in css
 
Web topic 17 font family in css
Web topic 17  font family in cssWeb topic 17  font family in css
Web topic 17 font family in css
 
Web topic 20 1 html forms
Web topic 20 1  html formsWeb topic 20 1  html forms
Web topic 20 1 html forms
 
Web topic 15 2 basic css layout
Web topic 15 2  basic css layoutWeb topic 15 2  basic css layout
Web topic 15 2 basic css layout
 
Web topic 16 css workflow
Web topic 16  css workflowWeb topic 16  css workflow
Web topic 16 css workflow
 
Web topic 20 2 html forms
Web topic 20 2  html formsWeb topic 20 2  html forms
Web topic 20 2 html forms
 
Web topic 23 web accessibility
Web topic 23  web accessibilityWeb topic 23  web accessibility
Web topic 23 web accessibility
 
Web topic 25 mobile optimized website
Web topic 25  mobile optimized websiteWeb topic 25  mobile optimized website
Web topic 25 mobile optimized website
 
Web topic 28. w3 c standards and guidelines
Web topic 28. w3 c standards and guidelinesWeb topic 28. w3 c standards and guidelines
Web topic 28. w3 c standards and guidelines
 
Web topic 14 cascading style sheets
Web topic 14  cascading style sheetsWeb topic 14  cascading style sheets
Web topic 14 cascading style sheets
 
Web topic 24 usage of web browser
Web topic 24  usage of web browserWeb topic 24  usage of web browser
Web topic 24 usage of web browser
 
Web topic 29 w3 c page validation
Web topic 29  w3 c page validationWeb topic 29  w3 c page validation
Web topic 29 w3 c page validation
 
Web topic 32 validate web contents
Web topic 32  validate web contentsWeb topic 32  validate web contents
Web topic 32 validate web contents
 
Web topic 30 ensure web contents meet
Web topic 30   ensure web contents meetWeb topic 30   ensure web contents meet
Web topic 30 ensure web contents meet
 
Web topic 29 w3 c page validation
Web topic 29  w3 c page validationWeb topic 29  w3 c page validation
Web topic 29 w3 c page validation
 
Web topic 15 1 basic css layout
Web topic 15 1  basic css layoutWeb topic 15 1  basic css layout
Web topic 15 1 basic css layout
 
Web topic 26 browser compatibilty and security
Web topic 26  browser compatibilty and securityWeb topic 26  browser compatibilty and security
Web topic 26 browser compatibilty and security
 
Web topic 31 setup remote site
Web topic 31  setup remote siteWeb topic 31  setup remote site
Web topic 31 setup remote site
 
Web topic 27 class test
Web topic 27  class testWeb topic 27  class test
Web topic 27 class test
 

Similar to Web topic 21 pass info via javascript

8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation
JohnLagman3
 
Java scipt
Java sciptJava scipt
Javascript
JavascriptJavascript
Javascript
Mayank Bhatt
 
Javascript
JavascriptJavascript
Javascript
Nagarajan
 
Javascript - Ebook (A Quick Guide)
Javascript - Ebook (A Quick Guide)Javascript - Ebook (A Quick Guide)
Javascript - Ebook (A Quick Guide)
sourav newatia
 
Java script
Java scriptJava script
Java script
Sadeek Mohammed
 
3. Java Script
3. Java Script3. Java Script
3. Java Script
Jalpesh Vasa
 
CSC PPT 12.pptx
CSC PPT 12.pptxCSC PPT 12.pptx
CSC PPT 12.pptx
DrRavneetSingh
 
Java script
Java scriptJava script
Java scriptKumar
 
Introduction to java script
Introduction to java scriptIntroduction to java script
Introduction to java script
nanjil1984
 
JavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript HereJavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript Here
Laurence Svekis ✔
 
Unit 4 Java script.pptx
Unit 4 Java script.pptxUnit 4 Java script.pptx
Unit 4 Java script.pptx
Gangesh8
 
Basic Java script handouts for students
Basic Java script handouts for students Basic Java script handouts for students
Basic Java script handouts for students
shafiq sangi
 
JAVA SCRIPT
JAVA SCRIPTJAVA SCRIPT
JAVA SCRIPT
Go4Guru
 
Unit 4(it workshop)
Unit 4(it workshop)Unit 4(it workshop)
Unit 4(it workshop)
Dr.Lokesh Gagnani
 
Introduction to JavaScript.pptx
Introduction to JavaScript.pptxIntroduction to JavaScript.pptx
Introduction to JavaScript.pptx
AxmedMaxamuud4
 
JavaScript - Chapter 3 - Introduction
 JavaScript - Chapter 3 - Introduction JavaScript - Chapter 3 - Introduction
JavaScript - Chapter 3 - Introduction
WebStackAcademy
 
JavaScript Basics with baby steps
JavaScript Basics with baby stepsJavaScript Basics with baby steps
JavaScript Basics with baby steps
Muhammad khurram khan
 
Week 7
Week 7Week 7
Week 7
A VD
 

Similar to Web topic 21 pass info via javascript (20)

8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation8.-Javascript-report powerpoint presentation
8.-Javascript-report powerpoint presentation
 
Java scipt
Java sciptJava scipt
Java scipt
 
Javascript
JavascriptJavascript
Javascript
 
Javascript
JavascriptJavascript
Javascript
 
Javascript - Ebook (A Quick Guide)
Javascript - Ebook (A Quick Guide)Javascript - Ebook (A Quick Guide)
Javascript - Ebook (A Quick Guide)
 
Java script
Java scriptJava script
Java script
 
3. Java Script
3. Java Script3. Java Script
3. Java Script
 
CSC PPT 12.pptx
CSC PPT 12.pptxCSC PPT 12.pptx
CSC PPT 12.pptx
 
Java script
Java scriptJava script
Java script
 
Introduction to java script
Introduction to java scriptIntroduction to java script
Introduction to java script
 
JavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript HereJavaScript Core fundamentals - Learn JavaScript Here
JavaScript Core fundamentals - Learn JavaScript Here
 
Unit 4 Java script.pptx
Unit 4 Java script.pptxUnit 4 Java script.pptx
Unit 4 Java script.pptx
 
Basic Java script handouts for students
Basic Java script handouts for students Basic Java script handouts for students
Basic Java script handouts for students
 
JAVA SCRIPT
JAVA SCRIPTJAVA SCRIPT
JAVA SCRIPT
 
Unit 4(it workshop)
Unit 4(it workshop)Unit 4(it workshop)
Unit 4(it workshop)
 
Introduction to JavaScript.pptx
Introduction to JavaScript.pptxIntroduction to JavaScript.pptx
Introduction to JavaScript.pptx
 
JavaScript - Chapter 3 - Introduction
 JavaScript - Chapter 3 - Introduction JavaScript - Chapter 3 - Introduction
JavaScript - Chapter 3 - Introduction
 
Javascript tutorial
Javascript tutorialJavascript tutorial
Javascript tutorial
 
JavaScript Basics with baby steps
JavaScript Basics with baby stepsJavaScript Basics with baby steps
JavaScript Basics with baby steps
 
Week 7
Week 7Week 7
Week 7
 

More from CK Yang

Web topic 33 publish websites
Web topic 33  publish websitesWeb topic 33  publish websites
Web topic 33 publish websitesCK Yang
 
Web topic 13 html validation tools
Web topic 13  html validation toolsWeb topic 13  html validation tools
Web topic 13 html validation toolsCK Yang
 
Web topic 12 tables in html
Web topic 12  tables in htmlWeb topic 12  tables in html
Web topic 12 tables in htmlCK Yang
 
Web topic 11 importance of html validation
Web topic 11  importance of html validationWeb topic 11  importance of html validation
Web topic 11 importance of html validationCK Yang
 
Web topic 10 2 web design basics
Web topic 10 2  web design basicsWeb topic 10 2  web design basics
Web topic 10 2 web design basicsCK Yang
 
Web topic 9 navigation and link
Web topic 9  navigation and linkWeb topic 9  navigation and link
Web topic 9 navigation and linkCK Yang
 
Web topic 8 listings in html
Web topic 8  listings in htmlWeb topic 8  listings in html
Web topic 8 listings in htmlCK Yang
 
Web topic 7 html tags for links
Web topic 7  html tags for linksWeb topic 7  html tags for links
Web topic 7 html tags for linksCK Yang
 
Web topic 5 text formatting
Web topic 5  text formattingWeb topic 5  text formatting
Web topic 5 text formattingCK Yang
 
Web topic 4 style in html
Web topic 4  style in htmlWeb topic 4  style in html
Web topic 4 style in htmlCK Yang
 

More from CK Yang (10)

Web topic 33 publish websites
Web topic 33  publish websitesWeb topic 33  publish websites
Web topic 33 publish websites
 
Web topic 13 html validation tools
Web topic 13  html validation toolsWeb topic 13  html validation tools
Web topic 13 html validation tools
 
Web topic 12 tables in html
Web topic 12  tables in htmlWeb topic 12  tables in html
Web topic 12 tables in html
 
Web topic 11 importance of html validation
Web topic 11  importance of html validationWeb topic 11  importance of html validation
Web topic 11 importance of html validation
 
Web topic 10 2 web design basics
Web topic 10 2  web design basicsWeb topic 10 2  web design basics
Web topic 10 2 web design basics
 
Web topic 9 navigation and link
Web topic 9  navigation and linkWeb topic 9  navigation and link
Web topic 9 navigation and link
 
Web topic 8 listings in html
Web topic 8  listings in htmlWeb topic 8  listings in html
Web topic 8 listings in html
 
Web topic 7 html tags for links
Web topic 7  html tags for linksWeb topic 7  html tags for links
Web topic 7 html tags for links
 
Web topic 5 text formatting
Web topic 5  text formattingWeb topic 5  text formatting
Web topic 5 text formatting
 
Web topic 4 style in html
Web topic 4  style in htmlWeb topic 4  style in html
Web topic 4 style in html
 

Recently uploaded

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
Alison B. Lowndes
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
ThousandEyes
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
Product School
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
Product School
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
Product School
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
RTTS
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Product School
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Tobias Schneck
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Jeffrey Haguewood
 

Recently uploaded (20)

GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........Bits & Pixels using AI for Good.........
Bits & Pixels using AI for Good.........
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
From Siloed Products to Connected Ecosystem: Building a Sustainable and Scala...
 
FIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdfFIDO Alliance Osaka Seminar: Overview.pdf
FIDO Alliance Osaka Seminar: Overview.pdf
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
Kubernetes & AI - Beauty and the Beast !?! @KCD Istanbul 2024
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 

Web topic 21 pass info via javascript

  • 1. Web Authoring Topic 21 – Passing Information via Javascript
  • 2. Objectives Students should able to: 1 Pass information via web forms using the submit button. 2. Identify and use the various JavaScript features: • Variables. • Custom and Build-in Functions • alert() • prompt()
  • 3. What is Javascript? JavaScript is a Web based programming language. It can be used to create dynamic Web pages. A dynamic Web page changes its appearance or the content depending on the user input or the time.
  • 4. Writing Javascript A JavaScript program can be embedded into our HTML code. <HEAD> <TITLE>My JavaScript page</TITLE> <SCRIPT LANGUAGE= “text/JavaScript”> </SCRIPT> </HEAD>
  • 5. Writing Javascript Some points to note about when writing Javascript. All JavaScript commands should come in between the <SCRIPT> and </SCRIPT> tags All JavaScript commands should be followed by a semicolon (;)
  • 6. Using Alert ALERT commands are messages, which pop up in a new small window. They automatically get closed when the user clicks OK button. Syntax of the ALERT command: <SCRIPT language = “text/JavaScript”> alert(“Hello world!”); </SCRIPT>
  • 7. Using variable We can use variables in JavaScript like other programming languages Use the var keyword to declare variables. var secsPerMin = 60; Variables must start with either a letter or the underscore character. Variable names are case-sensitive.
  • 8. Using prompt command The PROMPT command is used to get information from the user. Sample code: var a = prompt(“What is your name?”); var b = “Good Morning!” + a; alert (b);
  • 9. Using math operations We can use MATH operations to do calculations on the variables. Sample code: var secsPerHour = 0; secsPerHour = 24 * 60 * 60; alert (“The number of seconds in an year =” + secsPerHour);
  • 10. Displaying Text If we want to display text on the Web page, we can use the following command: document.write(“The number of seconds in an year=” +secs_per_year);
  • 11. Date object <SCRIPT LANGUAGE=”JavaScript”> var todayDate = new Date(); document.write("Today's Date is ") document.write(todayDate.getDate()); document.write(todayDate.getMonth()); document.write(todayDate.getYear()); </SCRIPT>
  • 12. Swapping Images Using JavaScript you can change the images when you place the mouse over it. This feature can be used to change button images, decorate images and to highlight the links.