SlideShare a Scribd company logo
1 of 10
JavaScript: What is it? 
• A programming language that (commonly) works 
client-side to control browser and website actions. 
• Common uses: 
– Screen movement 
– Mouse events 
– Pop up events (think notes & alerts) 
– Validate forms 
– Store information in cookies 
– Customize experience for specific users 
• Object-based (depending on who you talk to) 
• Embeds directly into an HTML page or linked to as a 
separate .js file.
How to code & test? 
• http://jsfiddle.net/ 
• Chrome Tools: JavaScript Console 
• Use Notepad++ to write JavaScript and save 
with .js extension… 
• …or just write it in your .html file! 
– http://www.u.arizona.edu/~londiem/crossroads_t 
yps_kairos-submission/home.html
Embedding in html 
<!DOCTYPE html> 
<html> 
<head> 
<title>My page title!</title> 
<meta charset=“UTF-8”> 
<link rel=“stylesheet” type=“text/css” href=“myfile.html” media=“screen”> 
<script type=“text/javascript”> 
…your code goes here!... 
</script> 
</head>
…and in individual html tags! 
<html> 
<head><title>My Page</title></head> 
<body> 
<br /> 
<p><a href="myfile.html">My Page</a></p> 
<br /> 
<br /> 
<br /> 
<br /> 
<p><a href="myfile.html" onMouseover="window.alert('Hello');">My Page</a></p> 
</body> 
</html>
Working with strings & statements 
alert(“DON’T PANIC!”); 
confirm(“Hurray for school!”); 
prompt(“Want some ice cream?”);
Variables 
• Used to store data. 
• You can give a variable a value, and you can 
change that value. 
• Most JavaScript code you will work with is 
simply a matter of assigning values to 
variables, looking up those values, and 
assigning new values.
Basic function syntax 
var NAME = function (PARAMETER) {ACTION} 
var square = function(number) { return number * number; }; 
alert(square(9));
Space is meaningless 
var square = function(num) { return num * num; }; 
alert(square(9)); 
var square = function (num) { 
return num * num; 
}; 
alert(square(9));
Tips 
• Check your " and ' quotes match 
• Carefully nest things (if you open something, 
close it) 
• Take care with capitalisation 
• Lay it out neatly - use tabs 
• Be patient

More Related Content

What's hot

JavaScript Introduction and Implementation
JavaScript Introduction and ImplementationJavaScript Introduction and Implementation
JavaScript Introduction and ImplementationMaher Hossain
 
Introduction to HTML, CSS, and Javascript
Introduction to HTML, CSS, and JavascriptIntroduction to HTML, CSS, and Javascript
Introduction to HTML, CSS, and JavascriptAgustinus Theodorus
 
JavaScript and jQuery Basics
JavaScript and jQuery BasicsJavaScript and jQuery Basics
JavaScript and jQuery BasicsKaloyan Kosev
 
Js placement
Js placementJs placement
Js placementSireesh K
 
Teaching Web Frontend Technologies To A Toddler
Teaching Web Frontend Technologies To A ToddlerTeaching Web Frontend Technologies To A Toddler
Teaching Web Frontend Technologies To A ToddlerOludotun Longe
 
Steve Barman - CSS and WordPress
Steve Barman - CSS and WordPressSteve Barman - CSS and WordPress
Steve Barman - CSS and WordPressAnthony Montalbano
 
Javascript inside Browser (DOM)
Javascript inside Browser (DOM)Javascript inside Browser (DOM)
Javascript inside Browser (DOM)Vlad Mysla
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom ManipulationMohammed Arif
 
Introduction to Jquery
Introduction to JqueryIntroduction to Jquery
Introduction to JqueryGurpreet singh
 
Javascript, DOM, browsers and frameworks basics
Javascript, DOM, browsers and frameworks basicsJavascript, DOM, browsers and frameworks basics
Javascript, DOM, browsers and frameworks basicsNet7
 
Java script how to
Java script how toJava script how to
Java script how tojulian vega
 
Web Page Development - An Overview
Web Page Development - An OverviewWeb Page Development - An Overview
Web Page Development - An OverviewCarlos J. Costa
 

What's hot (20)

JAVA SCRIPT
JAVA SCRIPTJAVA SCRIPT
JAVA SCRIPT
 
Html5 use cases
Html5 use casesHtml5 use cases
Html5 use cases
 
Introduction to java_script
Introduction to java_scriptIntroduction to java_script
Introduction to java_script
 
JavaScript Introduction and Implementation
JavaScript Introduction and ImplementationJavaScript Introduction and Implementation
JavaScript Introduction and Implementation
 
Introduction to HTML, CSS, and Javascript
Introduction to HTML, CSS, and JavascriptIntroduction to HTML, CSS, and Javascript
Introduction to HTML, CSS, and Javascript
 
JavaScript and jQuery Basics
JavaScript and jQuery BasicsJavaScript and jQuery Basics
JavaScript and jQuery Basics
 
Js placement
Js placementJs placement
Js placement
 
Teaching Web Frontend Technologies To A Toddler
Teaching Web Frontend Technologies To A ToddlerTeaching Web Frontend Technologies To A Toddler
Teaching Web Frontend Technologies To A Toddler
 
Steve Barman - CSS and WordPress
Steve Barman - CSS and WordPressSteve Barman - CSS and WordPress
Steve Barman - CSS and WordPress
 
HTML5
HTML5HTML5
HTML5
 
Java Script
Java ScriptJava Script
Java Script
 
Javascript inside Browser (DOM)
Javascript inside Browser (DOM)Javascript inside Browser (DOM)
Javascript inside Browser (DOM)
 
JavaScript and BOM events
JavaScript and BOM eventsJavaScript and BOM events
JavaScript and BOM events
 
JavaScript & Dom Manipulation
JavaScript & Dom ManipulationJavaScript & Dom Manipulation
JavaScript & Dom Manipulation
 
Introduction to Jquery
Introduction to JqueryIntroduction to Jquery
Introduction to Jquery
 
Jquery
JqueryJquery
Jquery
 
Javascript, DOM, browsers and frameworks basics
Javascript, DOM, browsers and frameworks basicsJavascript, DOM, browsers and frameworks basics
Javascript, DOM, browsers and frameworks basics
 
Java script how to
Java script how toJava script how to
Java script how to
 
Ajax Jump Start
Ajax Jump StartAjax Jump Start
Ajax Jump Start
 
Web Page Development - An Overview
Web Page Development - An OverviewWeb Page Development - An Overview
Web Page Development - An Overview
 

Similar to Intro to java script

JavaScript Fundamentals & JQuery
JavaScript Fundamentals & JQueryJavaScript Fundamentals & JQuery
JavaScript Fundamentals & JQueryJamshid Hashimi
 
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
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application developmentzonathen
 
Html5 and web technology update
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology updateDoug Domeny
 
IT2255 Web Essentials - Unit III Client-Side Processing and Scripting
IT2255 Web Essentials - Unit III Client-Side Processing and ScriptingIT2255 Web Essentials - Unit III Client-Side Processing and Scripting
IT2255 Web Essentials - Unit III Client-Side Processing and Scriptingpkaviya
 
Introduction to java script
Introduction to java scriptIntroduction to java script
Introduction to java scriptnanjil1984
 
SharePoint Cincy 2012 - jQuery essentials
SharePoint Cincy 2012 - jQuery essentialsSharePoint Cincy 2012 - jQuery essentials
SharePoint Cincy 2012 - jQuery essentialsMark Rackley
 
JavaScript with Syntax & Implementation
JavaScript with Syntax & ImplementationJavaScript with Syntax & Implementation
JavaScript with Syntax & ImplementationSoumen Santra
 

Similar to Intro to java script (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
 
Java script
Java scriptJava script
Java script
 
JavaScripts & jQuery
JavaScripts & jQueryJavaScripts & jQuery
JavaScripts & jQuery
 
JavaScript Fundamentals & JQuery
JavaScript Fundamentals & JQueryJavaScript Fundamentals & JQuery
JavaScript Fundamentals & JQuery
 
Java scipt
Java sciptJava scipt
Java scipt
 
Unit 4(it workshop)
Unit 4(it workshop)Unit 4(it workshop)
Unit 4(it workshop)
 
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
 
JavaScript Basics with baby steps
JavaScript Basics with baby stepsJavaScript Basics with baby steps
JavaScript Basics with baby steps
 
Java script
Java scriptJava script
Java script
 
Intro to mobile web application development
Intro to mobile web application developmentIntro to mobile web application development
Intro to mobile web application development
 
Html5 and web technology update
Html5 and web technology updateHtml5 and web technology update
Html5 and web technology update
 
IT2255 Web Essentials - Unit III Client-Side Processing and Scripting
IT2255 Web Essentials - Unit III Client-Side Processing and ScriptingIT2255 Web Essentials - Unit III Client-Side Processing and Scripting
IT2255 Web Essentials - Unit III Client-Side Processing and Scripting
 
JavaScript
JavaScriptJavaScript
JavaScript
 
JavaScript
JavaScriptJavaScript
JavaScript
 
Introduction to java script
Introduction to java scriptIntroduction to java script
Introduction to java script
 
SharePoint Cincy 2012 - jQuery essentials
SharePoint Cincy 2012 - jQuery essentialsSharePoint Cincy 2012 - jQuery essentials
SharePoint Cincy 2012 - jQuery essentials
 
JavaScript with Syntax & Implementation
JavaScript with Syntax & ImplementationJavaScript with Syntax & Implementation
JavaScript with Syntax & Implementation
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
 
Javascript
JavascriptJavascript
Javascript
 

Intro to java script

  • 1.
  • 2. JavaScript: What is it? • A programming language that (commonly) works client-side to control browser and website actions. • Common uses: – Screen movement – Mouse events – Pop up events (think notes & alerts) – Validate forms – Store information in cookies – Customize experience for specific users • Object-based (depending on who you talk to) • Embeds directly into an HTML page or linked to as a separate .js file.
  • 3. How to code & test? • http://jsfiddle.net/ • Chrome Tools: JavaScript Console • Use Notepad++ to write JavaScript and save with .js extension… • …or just write it in your .html file! – http://www.u.arizona.edu/~londiem/crossroads_t yps_kairos-submission/home.html
  • 4. Embedding in html <!DOCTYPE html> <html> <head> <title>My page title!</title> <meta charset=“UTF-8”> <link rel=“stylesheet” type=“text/css” href=“myfile.html” media=“screen”> <script type=“text/javascript”> …your code goes here!... </script> </head>
  • 5. …and in individual html tags! <html> <head><title>My Page</title></head> <body> <br /> <p><a href="myfile.html">My Page</a></p> <br /> <br /> <br /> <br /> <p><a href="myfile.html" onMouseover="window.alert('Hello');">My Page</a></p> </body> </html>
  • 6. Working with strings & statements alert(“DON’T PANIC!”); confirm(“Hurray for school!”); prompt(“Want some ice cream?”);
  • 7. Variables • Used to store data. • You can give a variable a value, and you can change that value. • Most JavaScript code you will work with is simply a matter of assigning values to variables, looking up those values, and assigning new values.
  • 8. Basic function syntax var NAME = function (PARAMETER) {ACTION} var square = function(number) { return number * number; }; alert(square(9));
  • 9. Space is meaningless var square = function(num) { return num * num; }; alert(square(9)); var square = function (num) { return num * num; }; alert(square(9));
  • 10. Tips • Check your " and ' quotes match • Carefully nest things (if you open something, close it) • Take care with capitalisation • Lay it out neatly - use tabs • Be patient