SlideShare a Scribd company logo
Introduction to 
Javascript and jQuery 
Kathy Zhou 
Tech Talk 
PennApps Fall 2014
Javascript 
programming language that runs in web browsers 
jQuery 
Javascript library for animations, effects, and making Javascript 
easy to use 
Kathy Zhou, PennApps Fall 2014 Tech Talk
What this talk WON’T do: 
- make you a Javascript expert in an hour (let’s be real, guys) 
- best to take CIS 197 or read Javascript: the Good Parts 
- explain all the weird nuances of the language 
- ‘null’ vs. ‘undefined’, ‘falsey’ values, you can look up 
- teach you functional programming 
- very important, I recommend studying 
Kathy Zhou, PennApps Fall 2014 Tech Talk
actual picture of you after this talk 
I promise 
What this talk WILL do: 
- make you a happy hacker 
- this is PennApps, after all 
- teach you the process of building a UI feature on your web app 
^ most important!! 
- point you in the right direction for learning more advanced 
features of Javascript and jQuery 
Kathy Zhou, PennApps Fall 2014 Tech Talk
This talk assumes you know: 
- basic HTML + CSS 
- basic programming (CIS110 or CIS120) 
Kathy Zhou, PennApps Fall 2014 Tech Talk
Basics of Javascript 
Kathy Zhou, PennApps Fall 2014 Tech Talk
‘running’ a Javascript program 
- a Javascript program is a script file 
- include it as a link in your HTML document, before the </body> tag 
Kathy Zhou, PennApps Fall 2014 Tech Talk
What you can do in Javascript 
- integers, floats, strings 
- lists 
- hash tables/dictionaries 
- for-loops 
Kathy Zhou, PennApps Fall 2014 Tech Talk
What you can do in Javascript 
- creating a function: line 21 
- calling a function: line 26 
Kathy Zhou, PennApps Fall 2014 Tech Talk
What is the DOM? 
Kathy Zhou, PennApps Fall 2014 Tech Talk
DOM: Document Object Model 
- every web page is represented 
as a tree structure 
- the root node is the <html> 
tag 
- child nodes are the nested 
tags in the document (<body>, 
<div>, <p>, etc.) 
Kathy Zhou, PennApps Fall 2014 Tech Talk
Javascript can manipulate the DOM 
- Javascript can dynamically 
remove or append tags 
- can modify text on the page 
Kathy Zhou, PennApps Fall 2014 Tech Talk
ex. adding an element to the page 
Kathy Zhou, PennApps Fall 2014 Tech Talk
Event handlers 
Kathy Zhou, PennApps Fall 2014 Tech Talk
What is an event handler? 
- the user interacts with the web page in different ways 
- clicking, typing, mouse-ing over elements, etc. 
- event handlers are functions that execute during particular user events 
on certain elements 
Kathy Zhou, PennApps Fall 2014 Tech Talk
ex. event handler for clicking on the <body> 
Kathy Zhou, PennApps Fall 2014 Tech Talk
Basics of jQuery 
Kathy Zhou, PennApps Fall 2014 Tech Talk
linking to the jQuery script file 
- lines 30-31: the proper way to link to jQuery 
- protip: remember to include it as the first link, and then include 
other javascript files after it 
Kathy Zhou, PennApps Fall 2014 Tech Talk
most important feature of jQuery 
(to you): easier manipulation of 
Kathy Zhou, PennApps Fall 2014 Tech Talk 
the DOM
ex. creating a pointer to an element on the page 
Kathy Zhou, PennApps Fall 2014 Tech Talk 
note the CSS notation 
“.” to access classes 
“#” to access IDs
ex. creating an event handler 
Kathy Zhou, PennApps Fall 2014 Tech Talk
protip: anything you want immediately executed, wrap in the jQuery 
document-ready construct 
Kathy Zhou, PennApps Fall 2014 Tech Talk
protip: the method ensures the page loads completely before the scripts 
execute 
you can also do $(document).ready(function () {...}); 
Kathy Zhou, PennApps Fall 2014 Tech Talk
protip: don’t do 
anonymous function 
handlers! 
always name your 
functions because it’s 
better for clarity and 
debugging 
Kathy Zhou, PennApps Fall 2014 Tech Talk
Kathy Zhou, PennApps Fall 2014 Tech Talk 
demo time!
autocomplete search bar 
Google → 
our demo → 
Kathy Zhou, PennApps Fall 2014 Tech Talk
download and extract files: 
https://github.com/KathyZ/talks/archive/master.zip 
Kathy Zhou, PennApps Fall 2014 Tech Talk
go into “pennappsf214Javascript” folder 
double-click on ‘index.html’ 
Kathy Zhou, PennApps Fall 2014 Tech Talk
Kathy Zhou, PennApps Fall 2014 Tech Talk 
*demo-ing*
workflow: steps to a UI feature 
1. identify the user actions 
- does something happen when the user 
clicks? when the user presses the ‘enter’ button? 
2. identify what visual aspects need to be 
there 
- consider which elements are added or 
removed, how they are modified, etc 
- also consider what CSS changes need to 
be made 
3. implementation 
Kathy Zhou, PennApps Fall 2014 Tech Talk
more learning 
for PennApps weekend: 
jQuery UI: http://jqueryui.com/ 
Foundation by ZURB: http://foundation.zurb.com/ 
Mozilla’s Javascript Guide: 
https://developer.mozilla.org/en-US/docs/Web/JavaScript 
jQuery documentation: 
http://api.jquery.com/ 
Airbnb’s Javascript style guide (best practices): 
https://github.com/airbnb/javascript 
Stack Overflow 
Kathy Zhou, PennApps Fall 2014 Tech Talk
thank you and happy hacking! 
@kaffkaff ← hit me up 
Kathy Zhou, PennApps Fall 2014 Tech Talk

More Related Content

PDF
An easy guide to Plugin Development
PPTX
Future proofing design work with Web components
PDF
So, you want to be a plugin developer?
PPTX
Web design 2 - Basic HTML 2010
PDF
Jumping Into WordPress Plugin Programming
PDF
greach 2014 marco vermeulen bdd using cucumber jvm and groovy
PDF
Wordpress Questions & Answers
PDF
Build WordPress themes like a heavyweight - WordCamp Lancaster 2013
An easy guide to Plugin Development
Future proofing design work with Web components
So, you want to be a plugin developer?
Web design 2 - Basic HTML 2010
Jumping Into WordPress Plugin Programming
greach 2014 marco vermeulen bdd using cucumber jvm and groovy
Wordpress Questions & Answers
Build WordPress themes like a heavyweight - WordCamp Lancaster 2013

What's hot (20)

PPTX
Denver topical homepages
PPTX
Leveraging Continuous Integration For Fun And Profit!
PDF
WordCamp Sheffield 2014 Theme Workflow Presentation
PPTX
Web Components in Action: building reusable components for web development
PDF
Managing a Project the Drupal Way - Drupal Open Days Ireland
PDF
Introduction to VueJS & The WordPress REST API
PDF
WordCamp Bournemouth 2014 - Designing with data in WordPress
PDF
Theming in WordPress - Where do I Start?
PDF
On Selecting JavaScript Frameworks (Women Who Code 10/15)
PPTX
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
PDF
Getting a CLUE at the Command Line
PDF
Web, Native iOS and Native Android with One Ember.js App
PPTX
What have you learnt about technologies from the
PPTX
JavaScript All The Things
DOC
Evaluation of project website
PDF
Writing Software not Code with Cucumber
PDF
Parse Apps with Ember.js
PDF
JavaScript Power Tools
PPTX
PDF
Rapid WordPress theme development
Denver topical homepages
Leveraging Continuous Integration For Fun And Profit!
WordCamp Sheffield 2014 Theme Workflow Presentation
Web Components in Action: building reusable components for web development
Managing a Project the Drupal Way - Drupal Open Days Ireland
Introduction to VueJS & The WordPress REST API
WordCamp Bournemouth 2014 - Designing with data in WordPress
Theming in WordPress - Where do I Start?
On Selecting JavaScript Frameworks (Women Who Code 10/15)
Getting Started with Test Automation: Introduction to Cucumber with Lapis Lazuli
Getting a CLUE at the Command Line
Web, Native iOS and Native Android with One Ember.js App
What have you learnt about technologies from the
JavaScript All The Things
Evaluation of project website
Writing Software not Code with Cucumber
Parse Apps with Ember.js
JavaScript Power Tools
Rapid WordPress theme development
Ad

Viewers also liked (7)

PPTX
Lesson 203 18 sep13-1500-ay
PPT
PPTX
PDF
03. oop concepts
PPTX
Basics of Object Oriented Programming
PPT
Java is an Object-Oriented Language
PPTX
Introduction to Object Oriented Concepts
Lesson 203 18 sep13-1500-ay
03. oop concepts
Basics of Object Oriented Programming
Java is an Object-Oriented Language
Introduction to Object Oriented Concepts
Ad

Similar to Javascript and jQuery PennApps Tech Talk, Fall 2014 (20)

PDF
User Experience Bootcamp for Developers
ZIP
Practical Accessibility
PDF
Php mysql-training online-by_php2ranjan
PDF
php training in hyderabad
PPTX
Building Shiny Application Series - Layout and HTML
PDF
Rapidly prototyping web applications using BackPress
ODP
2014 11 20 Drupal 7 -> 8 test migratie
PDF
Full stack-web-design
PDF
Introjs10.5.17SD
PPT
Enterprise PHP (PHP London Conference 2008)
PPT
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
PPTX
End-to-end testing with geb
PPT
PCC2 - How do I incorporate Apple-like design into my products?
PDF
Behaviour driven infrastructure
PDF
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
PPT
Simple Social Networking with Ruby on Rails
PPTX
Simplicity - develop modern web apps with tiny frameworks and tools
PPT
Presentations4 Session9
PDF
Progressive Web Application by Citytech
PPTX
Driven Development - Closing the Loop on Scrum
User Experience Bootcamp for Developers
Practical Accessibility
Php mysql-training online-by_php2ranjan
php training in hyderabad
Building Shiny Application Series - Layout and HTML
Rapidly prototyping web applications using BackPress
2014 11 20 Drupal 7 -> 8 test migratie
Full stack-web-design
Introjs10.5.17SD
Enterprise PHP (PHP London Conference 2008)
JBUG 11 - Django-The Web Framework For Perfectionists With Deadlines
End-to-end testing with geb
PCC2 - How do I incorporate Apple-like design into my products?
Behaviour driven infrastructure
WordCamp Greenville 2018 - Beware the Dark Side, or an Intro to Development
Simple Social Networking with Ruby on Rails
Simplicity - develop modern web apps with tiny frameworks and tools
Presentations4 Session9
Progressive Web Application by Citytech
Driven Development - Closing the Loop on Scrum

Recently uploaded (20)

PDF
2025 Textile ERP Trends: SAP, Odoo & Oracle
PPTX
L1 - Introduction to python Backend.pptx
PDF
System and Network Administration Chapter 2
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
medical staffing services at VALiNTRY
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
Transform Your Business with a Software ERP System
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Upgrade and Innovation Strategies for SAP ERP Customers
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
Softaken Excel to vCard Converter Software.pdf
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PDF
Digital Strategies for Manufacturing Companies
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
2025 Textile ERP Trends: SAP, Odoo & Oracle
L1 - Introduction to python Backend.pptx
System and Network Administration Chapter 2
Navsoft: AI-Powered Business Solutions & Custom Software Development
Odoo Companies in India – Driving Business Transformation.pdf
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PTS Company Brochure 2025 (1).pdf.......
medical staffing services at VALiNTRY
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
Operating system designcfffgfgggggggvggggggggg
Transform Your Business with a Software ERP System
Design an Analysis of Algorithms I-SECS-1021-03
Upgrade and Innovation Strategies for SAP ERP Customers
Digital Systems & Binary Numbers (comprehensive )
Softaken Excel to vCard Converter Software.pdf
VVF-Customer-Presentation2025-Ver1.9.pptx
Digital Strategies for Manufacturing Companies
How to Choose the Right IT Partner for Your Business in Malaysia
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Wondershare Filmora 15 Crack With Activation Key [2025

Javascript and jQuery PennApps Tech Talk, Fall 2014

  • 1. Introduction to Javascript and jQuery Kathy Zhou Tech Talk PennApps Fall 2014
  • 2. Javascript programming language that runs in web browsers jQuery Javascript library for animations, effects, and making Javascript easy to use Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 3. What this talk WON’T do: - make you a Javascript expert in an hour (let’s be real, guys) - best to take CIS 197 or read Javascript: the Good Parts - explain all the weird nuances of the language - ‘null’ vs. ‘undefined’, ‘falsey’ values, you can look up - teach you functional programming - very important, I recommend studying Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 4. actual picture of you after this talk I promise What this talk WILL do: - make you a happy hacker - this is PennApps, after all - teach you the process of building a UI feature on your web app ^ most important!! - point you in the right direction for learning more advanced features of Javascript and jQuery Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 5. This talk assumes you know: - basic HTML + CSS - basic programming (CIS110 or CIS120) Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 6. Basics of Javascript Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 7. ‘running’ a Javascript program - a Javascript program is a script file - include it as a link in your HTML document, before the </body> tag Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 8. What you can do in Javascript - integers, floats, strings - lists - hash tables/dictionaries - for-loops Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 9. What you can do in Javascript - creating a function: line 21 - calling a function: line 26 Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 10. What is the DOM? Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 11. DOM: Document Object Model - every web page is represented as a tree structure - the root node is the <html> tag - child nodes are the nested tags in the document (<body>, <div>, <p>, etc.) Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 12. Javascript can manipulate the DOM - Javascript can dynamically remove or append tags - can modify text on the page Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 13. ex. adding an element to the page Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 14. Event handlers Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 15. What is an event handler? - the user interacts with the web page in different ways - clicking, typing, mouse-ing over elements, etc. - event handlers are functions that execute during particular user events on certain elements Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 16. ex. event handler for clicking on the <body> Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 17. Basics of jQuery Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 18. linking to the jQuery script file - lines 30-31: the proper way to link to jQuery - protip: remember to include it as the first link, and then include other javascript files after it Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 19. most important feature of jQuery (to you): easier manipulation of Kathy Zhou, PennApps Fall 2014 Tech Talk the DOM
  • 20. ex. creating a pointer to an element on the page Kathy Zhou, PennApps Fall 2014 Tech Talk note the CSS notation “.” to access classes “#” to access IDs
  • 21. ex. creating an event handler Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 22. protip: anything you want immediately executed, wrap in the jQuery document-ready construct Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 23. protip: the method ensures the page loads completely before the scripts execute you can also do $(document).ready(function () {...}); Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 24. protip: don’t do anonymous function handlers! always name your functions because it’s better for clarity and debugging Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 25. Kathy Zhou, PennApps Fall 2014 Tech Talk demo time!
  • 26. autocomplete search bar Google → our demo → Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 27. download and extract files: https://github.com/KathyZ/talks/archive/master.zip Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 28. go into “pennappsf214Javascript” folder double-click on ‘index.html’ Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 29. Kathy Zhou, PennApps Fall 2014 Tech Talk *demo-ing*
  • 30. workflow: steps to a UI feature 1. identify the user actions - does something happen when the user clicks? when the user presses the ‘enter’ button? 2. identify what visual aspects need to be there - consider which elements are added or removed, how they are modified, etc - also consider what CSS changes need to be made 3. implementation Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 31. more learning for PennApps weekend: jQuery UI: http://jqueryui.com/ Foundation by ZURB: http://foundation.zurb.com/ Mozilla’s Javascript Guide: https://developer.mozilla.org/en-US/docs/Web/JavaScript jQuery documentation: http://api.jquery.com/ Airbnb’s Javascript style guide (best practices): https://github.com/airbnb/javascript Stack Overflow Kathy Zhou, PennApps Fall 2014 Tech Talk
  • 32. thank you and happy hacking! @kaffkaff ← hit me up Kathy Zhou, PennApps Fall 2014 Tech Talk