SlideShare a Scribd company logo
1 of 35
Applied Component I
Unit II
•Introduction of java-script
•Java-script in web browser
•Forms and form elements
•String manipulation
1.Introduction to java-script
1.Introduction to java-script
• Java-script is a powerful client level scripting
languages
• Java-script is not java
• Java-script is a best supported scripting language
for many browsers
• It can be written inside <script> tag or in file with
extension .js
• JavaScript is usually embedded directly into
HTML pages
• JavaScript is Case Sensitive
How to write java-script
<html>
<head>
<script language="javascript">
function call()
{
alert("do u have any problem! hold on");
alert("lets start learning java-script");
}
</script>
</head>
<body>
<input type="button" value="simple button" onclick="call()">
</body>
</html>
2.Client side java script
string objects
• The main purpose of String Object in
JavaScript is for storing text.
math objects
• The main purpose of math object in javaScript is
to perform math operation like sin,cos,tan
operations
array object
• It is a array handler in javascript
Date object
• It gives access to date method, for displaying and
setting date
Java script in web browser
window Object
• The window object represents the browser’s
frame or window, in which your web page is
contained
• via the properties of the window object you can
find out what browser is running, the pages the
user has visited, the size of the browser window,
the size of the user’s screen
• The window object is a global object, which
means you don’t need to use its name to access
its properties and methods
– window.alert(“Hello class!”);
– Window.defaultStatus = “see your status bar”
history Object
• The history object keeps track of each page
that the user visits
• This list of pages is commonly called the
history stack for the browser
• It enables the user to click the browser’s Back
and Forward buttons to revisit pages
• the history object has the back() and forward()
methods.
• The history object also has the go() method.
• history.back();
– one page back
• history.forward();
– One page forward
• history.go(-3);
– three page back
• history.go(3);
– Three page forward
location Object
• The location object contains lots of potentially
useful information about the current page’s
location.
– it contain the URL (Uniform Resource Locator) for
the page
– server hosting
– port number of the server connection
– the protocol used
Navigate using location object
• You can navigate to another page in two ways
– location object’s href property
– location object’s replace() method
• replace() method removes the current page
from the history stack and replaces it with the
new page
• href property simply adds the new page to the
top of the history stack
Navigator object
• navigator object contains lots of information
about the browser and the operating system
in which it’s running.
document Object—The Page Itself
• The document object has a number of
properties associated with it, which are also
arrays. The main ones are the forms, images,
and links arrays.
– document.bgColor=“green”;
– document.images.length
• This will return how many image are on web page
– document.images[“image1”].
• It is the array of images of name “image1”
Events and event handling
• Basic html event
– onclick=”alert(‘You Clicked?’)”
– Onload=“”
– Onunload=“”
• window.document.links["anc1"].onclick =
linkclick;
– Special event handler has to be load after full html
page is cached
3.Forms and form elements
Forms and form elements
• document.forms.length;
– Returns count of form tags on document
• Document.form1.button1.value=“hello”;
– Changes the value of button1
• document.form1.txt1.focus();
– Takes focus on txt1(textbox)
• document.form1.txt1.select();
– Selects all text in txt1(textbox)
Windows and frames
• var newWindow =
window.open(myURL,”myWindow”,”width=12
5,height=150,resizable”);
• newWindow.resizeTo(350,200);
– resize your window to 350 pixels wide by 200
pixels
• newWindow.moveTo(100,400);
– move it so it’s 100 pixels from the left of the
screen and 400 pixels from the top
• newWindow.resizeBy(100,200);
– increase the size of newWindow by 100 pixels
horizontally and 200 pixels vertically
• newWindow.moveBy(20,50);
– move the newWindow by 20 pixels horizontally
and 50 pixels vertically
Dynamic html
• DHTML is the manipulation of an HTML
document after it is loaded into the browser,
and the most common way to manipulate the
document is by changing the way HTML
elements look
Accessing Elements
• The Document Object Model (DOM) holds the
ability you need to find and access HTML
elements; the DOM is a hierarchical tree, and
you can certainly climb it, inspect every
branch and leaf, and find what you’re looking
for
• document.getElementById(“divAdvert”)
Changing Appearances
• document.getElementById(“divAdvert”).style.
color = “red”
Positioning and Moving Content
• document.getElementById("div1").style.left =
"100px";
• document.getElementById("div1").style.top =
"200px";
4.String manipulation
Additional String Methods
• split() Method
– var myString = “A,B,C”;
– var myTextArray = myString.split(‘,’);
• replace() Method
– var myString = “The event will be in May, the 21st
of June”;
– myCleanedUpString =
myString.replace(“May”,”June”);
• search() Method
– var myString = “Beginning JavaScript, Beginning
Java, Professional JavaScript”;
– alert(myString.search(“Java”));
• alert box that occurs will show the value 10,
which is the character position of the J in the
first occurrence of Java
• match() Method
– var myString = “1997, 1998, 1999, 2000, 2000,
2001, 2002”;
– myMatchArray = myString.match(“2000”);
– alert(myMatchArray.length);
• instead of returning the position at which a
match was found, it returns an array.
Regular expression
• A regular expression is an object that
describes a pattern of characters.
• Regular expressions are used to perform
pattern-matching and "search-and-replace"
functions on text.
• syntax
– var txt=/pattern/modifiers;
– var txt=new RegExp(pattern,modifiers);
modifiers
JavaScript Fundamentals for Beginners
JavaScript Fundamentals for Beginners
JavaScript Fundamentals for Beginners
JavaScript Fundamentals for Beginners
JavaScript Fundamentals for Beginners

More Related Content

What's hot

Introduction to html & css
Introduction to html & cssIntroduction to html & css
Introduction to html & csssesharao puvvada
 
Quick start guide to java script frameworks for sharepoint apps spsbe-2015
Quick start guide to java script frameworks for sharepoint apps spsbe-2015Quick start guide to java script frameworks for sharepoint apps spsbe-2015
Quick start guide to java script frameworks for sharepoint apps spsbe-2015Sonja Madsen
 
Rails database optimization
Rails database optimizationRails database optimization
Rails database optimizationKarsten Meier
 
Html5 and web technology update
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology updateDoug Domeny
 
JavaScript Frameworks for SharePoint add-ins Cambridge
JavaScript Frameworks for SharePoint add-ins CambridgeJavaScript Frameworks for SharePoint add-ins Cambridge
JavaScript Frameworks for SharePoint add-ins CambridgeSonja Madsen
 
Content by query web part
Content by query web partContent by query web part
Content by query web partIslamKhattab
 
Javascript in C# for Lightweight Applications
Javascript in C# for Lightweight ApplicationsJavascript in C# for Lightweight Applications
Javascript in C# for Lightweight ApplicationsVelanSalis
 
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology Ayes Chinmay
 
Xml dom & sax by bhavsingh maloth
Xml dom & sax by bhavsingh malothXml dom & sax by bhavsingh maloth
Xml dom & sax by bhavsingh malothBhavsingh Maloth
 
Connecting to a REST API in iOS
Connecting to a REST API in iOSConnecting to a REST API in iOS
Connecting to a REST API in iOSgillygize
 
Introduction to Programming (well, kind of.)
Introduction to Programming (well, kind of.)Introduction to Programming (well, kind of.)
Introduction to Programming (well, kind of.)Julie Meloni
 
MongoDB at ZPUGDC
MongoDB at ZPUGDCMongoDB at ZPUGDC
MongoDB at ZPUGDCMike Dirolf
 
FFW Gabrovo PMG - jQuery
FFW Gabrovo PMG - jQueryFFW Gabrovo PMG - jQuery
FFW Gabrovo PMG - jQueryToni Kolev
 
Harness SharePoint and jQuery to Make Dynamic Displays and Applications
 Harness SharePoint and jQuery to Make Dynamic Displays and Applications Harness SharePoint and jQuery to Make Dynamic Displays and Applications
Harness SharePoint and jQuery to Make Dynamic Displays and ApplicationsInnoTech
 
FFW Gabrovo PMG - JavaScript 1
FFW Gabrovo PMG - JavaScript 1FFW Gabrovo PMG - JavaScript 1
FFW Gabrovo PMG - JavaScript 1Toni Kolev
 
SharePointfest Denver - A jQuery Primer for SharePoint
SharePointfest Denver -  A jQuery Primer for SharePointSharePointfest Denver -  A jQuery Primer for SharePoint
SharePointfest Denver - A jQuery Primer for SharePointMarc D Anderson
 

What's hot (20)

Introduction to html & css
Introduction to html & cssIntroduction to html & css
Introduction to html & css
 
Quick start guide to java script frameworks for sharepoint apps spsbe-2015
Quick start guide to java script frameworks for sharepoint apps spsbe-2015Quick start guide to java script frameworks for sharepoint apps spsbe-2015
Quick start guide to java script frameworks for sharepoint apps spsbe-2015
 
Rails database optimization
Rails database optimizationRails database optimization
Rails database optimization
 
Html5 and web technology update
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology update
 
Azure F#unctions
Azure F#unctionsAzure F#unctions
Azure F#unctions
 
JavaScript Frameworks for SharePoint add-ins Cambridge
JavaScript Frameworks for SharePoint add-ins CambridgeJavaScript Frameworks for SharePoint add-ins Cambridge
JavaScript Frameworks for SharePoint add-ins Cambridge
 
Content by query web part
Content by query web partContent by query web part
Content by query web part
 
Javascript in C# for Lightweight Applications
Javascript in C# for Lightweight ApplicationsJavascript in C# for Lightweight Applications
Javascript in C# for Lightweight Applications
 
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
Internet and Web Technology (CLASS-10) [Node.js] | NIC/NIELIT Web Technology
 
Xml dom & sax by bhavsingh maloth
Xml dom & sax by bhavsingh malothXml dom & sax by bhavsingh maloth
Xml dom & sax by bhavsingh maloth
 
Java Script Basics
Java Script BasicsJava Script Basics
Java Script Basics
 
Connecting to a REST API in iOS
Connecting to a REST API in iOSConnecting to a REST API in iOS
Connecting to a REST API in iOS
 
Introduction to Programming (well, kind of.)
Introduction to Programming (well, kind of.)Introduction to Programming (well, kind of.)
Introduction to Programming (well, kind of.)
 
Part 7
Part 7Part 7
Part 7
 
MongoDB at ZPUGDC
MongoDB at ZPUGDCMongoDB at ZPUGDC
MongoDB at ZPUGDC
 
FFW Gabrovo PMG - jQuery
FFW Gabrovo PMG - jQueryFFW Gabrovo PMG - jQuery
FFW Gabrovo PMG - jQuery
 
Lec 7
Lec 7Lec 7
Lec 7
 
Harness SharePoint and jQuery to Make Dynamic Displays and Applications
 Harness SharePoint and jQuery to Make Dynamic Displays and Applications Harness SharePoint and jQuery to Make Dynamic Displays and Applications
Harness SharePoint and jQuery to Make Dynamic Displays and Applications
 
FFW Gabrovo PMG - JavaScript 1
FFW Gabrovo PMG - JavaScript 1FFW Gabrovo PMG - JavaScript 1
FFW Gabrovo PMG - JavaScript 1
 
SharePointfest Denver - A jQuery Primer for SharePoint
SharePointfest Denver -  A jQuery Primer for SharePointSharePointfest Denver -  A jQuery Primer for SharePoint
SharePointfest Denver - A jQuery Primer for SharePoint
 

Viewers also liked

Viewers also liked (7)

javaScript tutorial
javaScript tutorialjavaScript tutorial
javaScript tutorial
 
Chapter5 link layer and la ns
Chapter5 link layer and la nsChapter5 link layer and la ns
Chapter5 link layer and la ns
 
Javascript validating form
Javascript validating formJavascript validating form
Javascript validating form
 
Php course-syllabus
Php course-syllabusPhp course-syllabus
Php course-syllabus
 
Cookies and sessions
Cookies and sessionsCookies and sessions
Cookies and sessions
 
Js ppt
Js pptJs ppt
Js ppt
 
Cookies and sessions
Cookies and sessionsCookies and sessions
Cookies and sessions
 

Similar to JavaScript Fundamentals for Beginners

Learn javascript easy steps
Learn javascript easy stepsLearn javascript easy steps
Learn javascript easy stepsprince Loffar
 
Learning About JavaScript (…and its little buddy, JQuery!)
Learning About JavaScript (…and its little buddy, JQuery!)Learning About JavaScript (…and its little buddy, JQuery!)
Learning About JavaScript (…and its little buddy, JQuery!)Julie Meloni
 
Advanced guide to develop ajax applications using dojo
Advanced guide to develop ajax applications using dojoAdvanced guide to develop ajax applications using dojo
Advanced guide to develop ajax applications using dojoFu Cheng
 
Easy javascript
Easy javascriptEasy javascript
Easy javascriptBui Kiet
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)François Massart
 
Dom date and objects and event handling
Dom date and objects and event handlingDom date and objects and event handling
Dom date and objects and event handlingsmitha273566
 
WEB DEVELOPMENT.pptx
WEB DEVELOPMENT.pptxWEB DEVELOPMENT.pptx
WEB DEVELOPMENT.pptxsilvers5
 
Introduction to HTML language Web design.pptx
Introduction to HTML language Web design.pptxIntroduction to HTML language Web design.pptx
Introduction to HTML language Web design.pptxlekhacce
 
WEB TECHNOLOGY Unit-4.pptx
WEB TECHNOLOGY Unit-4.pptxWEB TECHNOLOGY Unit-4.pptx
WEB TECHNOLOGY Unit-4.pptxkarthiksmart21
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationLotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationSean Burgess
 
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 JSONSyed Moosa Kaleem
 

Similar to JavaScript Fundamentals for Beginners (20)

Learn javascript easy steps
Learn javascript easy stepsLearn javascript easy steps
Learn javascript easy steps
 
Learning About JavaScript (…and its little buddy, JQuery!)
Learning About JavaScript (…and its little buddy, JQuery!)Learning About JavaScript (…and its little buddy, JQuery!)
Learning About JavaScript (…and its little buddy, JQuery!)
 
Advanced guide to develop ajax applications using dojo
Advanced guide to develop ajax applications using dojoAdvanced guide to develop ajax applications using dojo
Advanced guide to develop ajax applications using dojo
 
Easy javascript
Easy javascriptEasy javascript
Easy javascript
 
HTML5, just another presentation :)
HTML5, just another presentation :)HTML5, just another presentation :)
HTML5, just another presentation :)
 
Dom date and objects and event handling
Dom date and objects and event handlingDom date and objects and event handling
Dom date and objects and event handling
 
WEB DEVELOPMENT.pptx
WEB DEVELOPMENT.pptxWEB DEVELOPMENT.pptx
WEB DEVELOPMENT.pptx
 
HTML5: Introduction
HTML5: IntroductionHTML5: Introduction
HTML5: Introduction
 
Introduction to HTML language Web design.pptx
Introduction to HTML language Web design.pptxIntroduction to HTML language Web design.pptx
Introduction to HTML language Web design.pptx
 
web development
web developmentweb development
web development
 
25444215.pptx
25444215.pptx25444215.pptx
25444215.pptx
 
web development
web developmentweb development
web development
 
Ajax workshop
Ajax workshopAjax workshop
Ajax workshop
 
WEB TECHNOLOGY Unit-4.pptx
WEB TECHNOLOGY Unit-4.pptxWEB TECHNOLOGY Unit-4.pptx
WEB TECHNOLOGY Unit-4.pptx
 
javaScript and jQuery
javaScript and jQueryjavaScript and jQuery
javaScript and jQuery
 
Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3Intro to HTML 5 / CSS 3
Intro to HTML 5 / CSS 3
 
Html5 n css3
Html5 n css3Html5 n css3
Html5 n css3
 
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD CombinationLotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
Lotusphere 2012 Speedgeeking - jQuery & Domino, a RAD Combination
 
JS Essence
JS EssenceJS Essence
JS Essence
 
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
 

Recently uploaded

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Hyundai Motor Group
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAndikSusilo4
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2Next-generation AAM aircraft unveiled by Supernal, S-A2
Next-generation AAM aircraft unveiled by Supernal, S-A2
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Azure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & ApplicationAzure Monitor & Application Insight to monitor Infrastructure & Application
Azure Monitor & Application Insight to monitor Infrastructure & Application
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

JavaScript Fundamentals for Beginners

  • 1. Applied Component I Unit II •Introduction of java-script •Java-script in web browser •Forms and form elements •String manipulation
  • 3. 1.Introduction to java-script • Java-script is a powerful client level scripting languages • Java-script is not java • Java-script is a best supported scripting language for many browsers • It can be written inside <script> tag or in file with extension .js • JavaScript is usually embedded directly into HTML pages • JavaScript is Case Sensitive
  • 4. How to write java-script <html> <head> <script language="javascript"> function call() { alert("do u have any problem! hold on"); alert("lets start learning java-script"); } </script> </head> <body> <input type="button" value="simple button" onclick="call()"> </body> </html>
  • 6. string objects • The main purpose of String Object in JavaScript is for storing text. math objects • The main purpose of math object in javaScript is to perform math operation like sin,cos,tan operations
  • 7. array object • It is a array handler in javascript Date object • It gives access to date method, for displaying and setting date
  • 8. Java script in web browser
  • 9. window Object • The window object represents the browser’s frame or window, in which your web page is contained • via the properties of the window object you can find out what browser is running, the pages the user has visited, the size of the browser window, the size of the user’s screen • The window object is a global object, which means you don’t need to use its name to access its properties and methods – window.alert(“Hello class!”); – Window.defaultStatus = “see your status bar”
  • 10. history Object • The history object keeps track of each page that the user visits • This list of pages is commonly called the history stack for the browser • It enables the user to click the browser’s Back and Forward buttons to revisit pages • the history object has the back() and forward() methods. • The history object also has the go() method.
  • 11. • history.back(); – one page back • history.forward(); – One page forward • history.go(-3); – three page back • history.go(3); – Three page forward
  • 12. location Object • The location object contains lots of potentially useful information about the current page’s location. – it contain the URL (Uniform Resource Locator) for the page – server hosting – port number of the server connection – the protocol used
  • 13. Navigate using location object • You can navigate to another page in two ways – location object’s href property – location object’s replace() method • replace() method removes the current page from the history stack and replaces it with the new page • href property simply adds the new page to the top of the history stack
  • 14. Navigator object • navigator object contains lots of information about the browser and the operating system in which it’s running.
  • 15. document Object—The Page Itself • The document object has a number of properties associated with it, which are also arrays. The main ones are the forms, images, and links arrays. – document.bgColor=“green”; – document.images.length • This will return how many image are on web page – document.images[“image1”]. • It is the array of images of name “image1”
  • 16. Events and event handling • Basic html event – onclick=”alert(‘You Clicked?’)” – Onload=“” – Onunload=“” • window.document.links["anc1"].onclick = linkclick; – Special event handler has to be load after full html page is cached
  • 17. 3.Forms and form elements
  • 18. Forms and form elements • document.forms.length; – Returns count of form tags on document • Document.form1.button1.value=“hello”; – Changes the value of button1 • document.form1.txt1.focus(); – Takes focus on txt1(textbox) • document.form1.txt1.select(); – Selects all text in txt1(textbox)
  • 19. Windows and frames • var newWindow = window.open(myURL,”myWindow”,”width=12 5,height=150,resizable”); • newWindow.resizeTo(350,200); – resize your window to 350 pixels wide by 200 pixels • newWindow.moveTo(100,400); – move it so it’s 100 pixels from the left of the screen and 400 pixels from the top
  • 20. • newWindow.resizeBy(100,200); – increase the size of newWindow by 100 pixels horizontally and 200 pixels vertically • newWindow.moveBy(20,50); – move the newWindow by 20 pixels horizontally and 50 pixels vertically
  • 21. Dynamic html • DHTML is the manipulation of an HTML document after it is loaded into the browser, and the most common way to manipulate the document is by changing the way HTML elements look
  • 22. Accessing Elements • The Document Object Model (DOM) holds the ability you need to find and access HTML elements; the DOM is a hierarchical tree, and you can certainly climb it, inspect every branch and leaf, and find what you’re looking for • document.getElementById(“divAdvert”)
  • 24. Positioning and Moving Content • document.getElementById("div1").style.left = "100px"; • document.getElementById("div1").style.top = "200px";
  • 26. Additional String Methods • split() Method – var myString = “A,B,C”; – var myTextArray = myString.split(‘,’); • replace() Method – var myString = “The event will be in May, the 21st of June”; – myCleanedUpString = myString.replace(“May”,”June”);
  • 27. • search() Method – var myString = “Beginning JavaScript, Beginning Java, Professional JavaScript”; – alert(myString.search(“Java”)); • alert box that occurs will show the value 10, which is the character position of the J in the first occurrence of Java
  • 28. • match() Method – var myString = “1997, 1998, 1999, 2000, 2000, 2001, 2002”; – myMatchArray = myString.match(“2000”); – alert(myMatchArray.length); • instead of returning the position at which a match was found, it returns an array.
  • 29. Regular expression • A regular expression is an object that describes a pattern of characters. • Regular expressions are used to perform pattern-matching and "search-and-replace" functions on text. • syntax – var txt=/pattern/modifiers; – var txt=new RegExp(pattern,modifiers);