SlideShare a Scribd company logo
1 of 16
Unit 2: jQuery
Lesson 6: Tying It Together
October 14, 2013
Lesson 6: Tying It Together
Introduction
to jQuery

Syntax and
Structure

Abstraction

Events

Lesson 1

Lesson 2

Lesson 3

Lesson 4

TBD

Effects

Tying It
Together

Identifying
Events

Lesson 8

Lesson 7

Lesson 6

Lesson 5

TBD

TBD

TBD

TBD

Lesson 9

Lesson 10

Lesson 11

Lesson 12

2
Recap from last time (I)
• Whenever you search on Google, look to buy something on
Amazon, or scroll through your Facebook News Feed, you are
probably triggering events
• Events play an important role in creating a rich user experience
and so they appear on every interactive page—or almost all the
websites you regularly visit

Google

Amazon

Facebook
3
Recap from last time (II)
• Websites use events to make tasks as basic as filling out a form
become as seamless as possible!

Clicking in the text field triggers the
border to turn blue
Clicking out of an empty text field
triggers the border to turn red and
causes an alert message to appear

4
HTML. CSS. Now jQuery! (I)
•

We saw in Unit 1 how HTML and CSS files work together:
• The HTML file stores the code that relates to the structure of
the page

5
HTML. CSS. Now jQuery! (II)
•

We saw in Unit 1 how HTML and CSS files work together:
• The HTML file stores the code that relates to the structure of
the page
• A separate CSS file contains the code that affects the
appearance of the page, and a line in the HTML code tells the
browser where to find this file

6
HTML. CSS. Now jQuery! (III)
•

•

We saw in Unit 1 how HTML and CSS files work together:
• The HTML file stores the code that relates to the structure of
the page
• A separate CSS file contains the code that affects the
appearance of the page, and a line in the HTML code tells the
browser where to find this file
So what happens when we add jQuery?

?
7
More than one way to work with jQuery (I)
•

•

Just like with CSS, there are multiple places to keep your jQuery
code, all of which are valid
For example, you could:
1. Place jQuery code at the bottom of the HTML file

Example 1

8
More than one way to work with jQuery (II)
•

•

Just like with CSS, there are multiple places to keep your jQuery
code, all of which are valid
For example, you could:
1. Place jQuery code at the bottom of the HTML file

2. Store jQuery in a separate sheet linked to the HTML file

Example 1

Example 2

9
Three reasons to keep jQuery in a separate file
•

While both of these are valid, it’s best to store our jQuery code in
a separate file for the same reasons why we keep our HTML
separate from our CSS

Saves time by reusing code
(Don’t Repeat Yourself)

Helps to debug code
(Avoid code bloat)

Keeps us organized
(Separation of concerns)

10
Website with HTML and jQuery walkthrough
•

x

11
Website with HTML, CSS, and jQuery
walkthrough
•

x

12
Summary (I)
• There is more than one valid place to put jQuery code:
1. At the bottom of the HTML file
2. In a separate sheet linked to the HTML file
• However, it’s best to store jQuery code in a separate file for the
same reasons why we keep our HTML separate from our CSS

13
Summary (II)
• There is more than one valid place to put jQuery code:
1. At the bottom of the HTML file
2. In a separate sheet linked to the HTML file
• However, it’s best to store jQuery code in a separate file for the
same reasons why we keep our HTML separate from our CSS
Saves time by reusing code
(Don’t Repeat Yourself)

Helps to debug code
(Avoid code bloat)

Keeps us organized
(Separation of concerns)

14
Summary (III)
• x

15
What to do on your own
1. Go to URL to complete the Codecademy course online

2. Do the practice set on the material learned

1. Take the follow-up quiz to test your understanding

16

More Related Content

What's hot

การตั้งกองทุนจมและการบันทึกบัญชี
การตั้งกองทุนจมและการบันทึกบัญชีการตั้งกองทุนจมและการบันทึกบัญชี
การตั้งกองทุนจมและการบันทึกบัญชี
taksapornKeawngoen
 
การตั้งกองทุนจมและการบันทึกบัญชี
การตั้งกองทุนจมและการบันทึกบัญชีการตั้งกองทุนจมและการบันทึกบัญชี
การตั้งกองทุนจมและการบันทึกบัญชี
taksapornKeawngoen
 
On the incoherencies in web browser access control
On the incoherencies in web browser access controlOn the incoherencies in web browser access control
On the incoherencies in web browser access control
UT, San Antonio
 

What's hot (13)

Don’t forget to add doctype
Don’t forget to add doctypeDon’t forget to add doctype
Don’t forget to add doctype
 
Javascript ch8
Javascript ch8Javascript ch8
Javascript ch8
 
Introduction to the Web and HTML
Introduction to the Web and HTMLIntroduction to the Web and HTML
Introduction to the Web and HTML
 
Google docs tips and tricks
Google docs tips and tricksGoogle docs tips and tricks
Google docs tips and tricks
 
การตั้งกองทุนจมและการบันทึกบัญชี
การตั้งกองทุนจมและการบันทึกบัญชีการตั้งกองทุนจมและการบันทึกบัญชี
การตั้งกองทุนจมและการบันทึกบัญชี
 
การตั้งกองทุนจมและการบันทึกบัญชี
การตั้งกองทุนจมและการบันทึกบัญชีการตั้งกองทุนจมและการบันทึกบัญชี
การตั้งกองทุนจมและการบันทึกบัญชี
 
On the incoherencies in web browser access control
On the incoherencies in web browser access controlOn the incoherencies in web browser access control
On the incoherencies in web browser access control
 
html5 new structural elements
html5 new structural elements html5 new structural elements
html5 new structural elements
 
Introduction to OpenOffice.org 2.0
Introduction to OpenOffice.org 2.0Introduction to OpenOffice.org 2.0
Introduction to OpenOffice.org 2.0
 
What's a web page made of?
What's a web page made of?What's a web page made of?
What's a web page made of?
 
Upstate CSCI 450 jQuery
Upstate CSCI 450 jQueryUpstate CSCI 450 jQuery
Upstate CSCI 450 jQuery
 
Open Standard
Open StandardOpen Standard
Open Standard
 
Livebinders Guide
Livebinders GuideLivebinders Guide
Livebinders Guide
 

Viewers also liked

Lesson 109 23 aug13-1430-ay
Lesson 109 23 aug13-1430-ayLesson 109 23 aug13-1430-ay
Lesson 109 23 aug13-1430-ay
Codecademy Ren
 
Teaching presentation
Teaching presentationTeaching presentation
Teaching presentation
jakia123
 
Lesson 302 05 jan14-1500-ay
Lesson 302 05 jan14-1500-ayLesson 302 05 jan14-1500-ay
Lesson 302 05 jan14-1500-ay
Codecademy Ren
 
Lesson 112 24 aug13-2300-ay
Lesson 112 24 aug13-2300-ayLesson 112 24 aug13-2300-ay
Lesson 112 24 aug13-2300-ay
Codecademy Ren
 
Lesson 101 23 aug13-1430-ay
Lesson 101 23 aug13-1430-ayLesson 101 23 aug13-1430-ay
Lesson 101 23 aug13-1430-ay
Codecademy Ren
 
Lesson 304 05 jan14-1500-ay
Lesson 304 05 jan14-1500-ayLesson 304 05 jan14-1500-ay
Lesson 304 05 jan14-1500-ay
Codecademy Ren
 

Viewers also liked (6)

Lesson 109 23 aug13-1430-ay
Lesson 109 23 aug13-1430-ayLesson 109 23 aug13-1430-ay
Lesson 109 23 aug13-1430-ay
 
Teaching presentation
Teaching presentationTeaching presentation
Teaching presentation
 
Lesson 302 05 jan14-1500-ay
Lesson 302 05 jan14-1500-ayLesson 302 05 jan14-1500-ay
Lesson 302 05 jan14-1500-ay
 
Lesson 112 24 aug13-2300-ay
Lesson 112 24 aug13-2300-ayLesson 112 24 aug13-2300-ay
Lesson 112 24 aug13-2300-ay
 
Lesson 101 23 aug13-1430-ay
Lesson 101 23 aug13-1430-ayLesson 101 23 aug13-1430-ay
Lesson 101 23 aug13-1430-ay
 
Lesson 304 05 jan14-1500-ay
Lesson 304 05 jan14-1500-ayLesson 304 05 jan14-1500-ay
Lesson 304 05 jan14-1500-ay
 

Similar to Lesson 206 11 oct13-1500-ay

Lesson 207 19 oct13-1500-ay
Lesson 207 19 oct13-1500-ayLesson 207 19 oct13-1500-ay
Lesson 207 19 oct13-1500-ay
Codecademy Ren
 
Lesson 201 14 sep13-1500-ay
Lesson 201 14 sep13-1500-ayLesson 201 14 sep13-1500-ay
Lesson 201 14 sep13-1500-ay
Codecademy Ren
 
Lesson 102 23 aug13-1430-ay
Lesson 102 23 aug13-1430-ayLesson 102 23 aug13-1430-ay
Lesson 102 23 aug13-1430-ay
Codecademy Ren
 
Lesson 102 25 aug13-2200-ay
Lesson 102 25 aug13-2200-ayLesson 102 25 aug13-2200-ay
Lesson 102 25 aug13-2200-ay
Codecademy Ren
 
Lesson 104 23 aug13-1430-ay
Lesson 104 23 aug13-1430-ayLesson 104 23 aug13-1430-ay
Lesson 104 23 aug13-1430-ay
Codecademy Ren
 
Lesson 203 18 sep13-1500-ay
Lesson 203 18 sep13-1500-ayLesson 203 18 sep13-1500-ay
Lesson 203 18 sep13-1500-ay
Codecademy Ren
 
JS Libraries and jQuery Overview
JS Libraries and jQuery OverviewJS Libraries and jQuery Overview
JS Libraries and jQuery Overview
Aleksandr Motsjonov
 
HTML 5, CSS3 and ASP.NET Best Practices by Example
HTML 5, CSS3 and ASP.NET Best Practices by ExampleHTML 5, CSS3 and ASP.NET Best Practices by Example
HTML 5, CSS3 and ASP.NET Best Practices by Example
Darren Sim
 
J query presentation
J query presentationJ query presentation
J query presentation
akanksha17
 
J query presentation
J query presentationJ query presentation
J query presentation
sawarkar17
 
Lesson 108 23 aug13-1430-ay
Lesson 108 23 aug13-1430-ayLesson 108 23 aug13-1430-ay
Lesson 108 23 aug13-1430-ay
Codecademy Ren
 

Similar to Lesson 206 11 oct13-1500-ay (20)

Lesson 207 19 oct13-1500-ay
Lesson 207 19 oct13-1500-ayLesson 207 19 oct13-1500-ay
Lesson 207 19 oct13-1500-ay
 
Lesson 201 14 sep13-1500-ay
Lesson 201 14 sep13-1500-ayLesson 201 14 sep13-1500-ay
Lesson 201 14 sep13-1500-ay
 
Lesson 102 23 aug13-1430-ay
Lesson 102 23 aug13-1430-ayLesson 102 23 aug13-1430-ay
Lesson 102 23 aug13-1430-ay
 
Lesson 102 25 aug13-2200-ay
Lesson 102 25 aug13-2200-ayLesson 102 25 aug13-2200-ay
Lesson 102 25 aug13-2200-ay
 
Lesson 104 23 aug13-1430-ay
Lesson 104 23 aug13-1430-ayLesson 104 23 aug13-1430-ay
Lesson 104 23 aug13-1430-ay
 
Lesson 203 18 sep13-1500-ay
Lesson 203 18 sep13-1500-ayLesson 203 18 sep13-1500-ay
Lesson 203 18 sep13-1500-ay
 
Swf search final
Swf search finalSwf search final
Swf search final
 
2012 - HTML5, CSS3 and jQuery with SharePoint 2010
2012 - HTML5, CSS3 and jQuery with SharePoint 20102012 - HTML5, CSS3 and jQuery with SharePoint 2010
2012 - HTML5, CSS3 and jQuery with SharePoint 2010
 
JS Libraries and jQuery Overview
JS Libraries and jQuery OverviewJS Libraries and jQuery Overview
JS Libraries and jQuery Overview
 
HTML5_3.ppt
HTML5_3.pptHTML5_3.ppt
HTML5_3.ppt
 
HTML 5, CSS3 and ASP.NET Best Practices by Example
HTML 5, CSS3 and ASP.NET Best Practices by ExampleHTML 5, CSS3 and ASP.NET Best Practices by Example
HTML 5, CSS3 and ASP.NET Best Practices by Example
 
Manual en Dive Into html5
Manual en Dive Into html5Manual en Dive Into html5
Manual en Dive Into html5
 
Html5
Html5Html5
Html5
 
J query presentation
J query presentationJ query presentation
J query presentation
 
J query presentation
J query presentationJ query presentation
J query presentation
 
jQuery quick tips
jQuery quick tipsjQuery quick tips
jQuery quick tips
 
Html Tutorial
Html Tutorial Html Tutorial
Html Tutorial
 
Jquery
JqueryJquery
Jquery
 
Lesson 108 23 aug13-1430-ay
Lesson 108 23 aug13-1430-ayLesson 108 23 aug13-1430-ay
Lesson 108 23 aug13-1430-ay
 
Jquery
JqueryJquery
Jquery
 

More from Codecademy Ren

Lesson 303 05 jan14-1500-ay
Lesson 303 05 jan14-1500-ayLesson 303 05 jan14-1500-ay
Lesson 303 05 jan14-1500-ay
Codecademy Ren
 
Lesson 301 26 nov13-1500-ay
Lesson 301 26 nov13-1500-ayLesson 301 26 nov13-1500-ay
Lesson 301 26 nov13-1500-ay
Codecademy Ren
 
Lesson 205 07 oct13-1500-ay
Lesson 205 07 oct13-1500-ayLesson 205 07 oct13-1500-ay
Lesson 205 07 oct13-1500-ay
Codecademy Ren
 
Lesson 204 03 oct13-1500-ay
Lesson 204 03 oct13-1500-ayLesson 204 03 oct13-1500-ay
Lesson 204 03 oct13-1500-ay
Codecademy Ren
 
Lesson 202 02 oct13-1800-ay
Lesson 202 02 oct13-1800-ayLesson 202 02 oct13-1800-ay
Lesson 202 02 oct13-1800-ay
Codecademy Ren
 
Lesson 106 23 aug13-1430-ay
Lesson 106 23 aug13-1430-ayLesson 106 23 aug13-1430-ay
Lesson 106 23 aug13-1430-ay
Codecademy Ren
 
Lesson 105 23 aug13-1430-ay
Lesson 105 23 aug13-1430-ayLesson 105 23 aug13-1430-ay
Lesson 105 23 aug13-1430-ay
Codecademy Ren
 
Lesson 103 23 aug13-1430-ay
Lesson 103 23 aug13-1430-ayLesson 103 23 aug13-1430-ay
Lesson 103 23 aug13-1430-ay
Codecademy Ren
 
Lesson 111 24 aug13-1430-ay
Lesson 111 24 aug13-1430-ayLesson 111 24 aug13-1430-ay
Lesson 111 24 aug13-1430-ay
Codecademy Ren
 

More from Codecademy Ren (9)

Lesson 303 05 jan14-1500-ay
Lesson 303 05 jan14-1500-ayLesson 303 05 jan14-1500-ay
Lesson 303 05 jan14-1500-ay
 
Lesson 301 26 nov13-1500-ay
Lesson 301 26 nov13-1500-ayLesson 301 26 nov13-1500-ay
Lesson 301 26 nov13-1500-ay
 
Lesson 205 07 oct13-1500-ay
Lesson 205 07 oct13-1500-ayLesson 205 07 oct13-1500-ay
Lesson 205 07 oct13-1500-ay
 
Lesson 204 03 oct13-1500-ay
Lesson 204 03 oct13-1500-ayLesson 204 03 oct13-1500-ay
Lesson 204 03 oct13-1500-ay
 
Lesson 202 02 oct13-1800-ay
Lesson 202 02 oct13-1800-ayLesson 202 02 oct13-1800-ay
Lesson 202 02 oct13-1800-ay
 
Lesson 106 23 aug13-1430-ay
Lesson 106 23 aug13-1430-ayLesson 106 23 aug13-1430-ay
Lesson 106 23 aug13-1430-ay
 
Lesson 105 23 aug13-1430-ay
Lesson 105 23 aug13-1430-ayLesson 105 23 aug13-1430-ay
Lesson 105 23 aug13-1430-ay
 
Lesson 103 23 aug13-1430-ay
Lesson 103 23 aug13-1430-ayLesson 103 23 aug13-1430-ay
Lesson 103 23 aug13-1430-ay
 
Lesson 111 24 aug13-1430-ay
Lesson 111 24 aug13-1430-ayLesson 111 24 aug13-1430-ay
Lesson 111 24 aug13-1430-ay
 

Recently uploaded

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 

Lesson 206 11 oct13-1500-ay

  • 1. Unit 2: jQuery Lesson 6: Tying It Together October 14, 2013
  • 2. Lesson 6: Tying It Together Introduction to jQuery Syntax and Structure Abstraction Events Lesson 1 Lesson 2 Lesson 3 Lesson 4 TBD Effects Tying It Together Identifying Events Lesson 8 Lesson 7 Lesson 6 Lesson 5 TBD TBD TBD TBD Lesson 9 Lesson 10 Lesson 11 Lesson 12 2
  • 3. Recap from last time (I) • Whenever you search on Google, look to buy something on Amazon, or scroll through your Facebook News Feed, you are probably triggering events • Events play an important role in creating a rich user experience and so they appear on every interactive page—or almost all the websites you regularly visit Google Amazon Facebook 3
  • 4. Recap from last time (II) • Websites use events to make tasks as basic as filling out a form become as seamless as possible! Clicking in the text field triggers the border to turn blue Clicking out of an empty text field triggers the border to turn red and causes an alert message to appear 4
  • 5. HTML. CSS. Now jQuery! (I) • We saw in Unit 1 how HTML and CSS files work together: • The HTML file stores the code that relates to the structure of the page 5
  • 6. HTML. CSS. Now jQuery! (II) • We saw in Unit 1 how HTML and CSS files work together: • The HTML file stores the code that relates to the structure of the page • A separate CSS file contains the code that affects the appearance of the page, and a line in the HTML code tells the browser where to find this file 6
  • 7. HTML. CSS. Now jQuery! (III) • • We saw in Unit 1 how HTML and CSS files work together: • The HTML file stores the code that relates to the structure of the page • A separate CSS file contains the code that affects the appearance of the page, and a line in the HTML code tells the browser where to find this file So what happens when we add jQuery? ? 7
  • 8. More than one way to work with jQuery (I) • • Just like with CSS, there are multiple places to keep your jQuery code, all of which are valid For example, you could: 1. Place jQuery code at the bottom of the HTML file Example 1 8
  • 9. More than one way to work with jQuery (II) • • Just like with CSS, there are multiple places to keep your jQuery code, all of which are valid For example, you could: 1. Place jQuery code at the bottom of the HTML file 2. Store jQuery in a separate sheet linked to the HTML file Example 1 Example 2 9
  • 10. Three reasons to keep jQuery in a separate file • While both of these are valid, it’s best to store our jQuery code in a separate file for the same reasons why we keep our HTML separate from our CSS Saves time by reusing code (Don’t Repeat Yourself) Helps to debug code (Avoid code bloat) Keeps us organized (Separation of concerns) 10
  • 11. Website with HTML and jQuery walkthrough • x 11
  • 12. Website with HTML, CSS, and jQuery walkthrough • x 12
  • 13. Summary (I) • There is more than one valid place to put jQuery code: 1. At the bottom of the HTML file 2. In a separate sheet linked to the HTML file • However, it’s best to store jQuery code in a separate file for the same reasons why we keep our HTML separate from our CSS 13
  • 14. Summary (II) • There is more than one valid place to put jQuery code: 1. At the bottom of the HTML file 2. In a separate sheet linked to the HTML file • However, it’s best to store jQuery code in a separate file for the same reasons why we keep our HTML separate from our CSS Saves time by reusing code (Don’t Repeat Yourself) Helps to debug code (Avoid code bloat) Keeps us organized (Separation of concerns) 14
  • 16. What to do on your own 1. Go to URL to complete the Codecademy course online 2. Do the practice set on the material learned 1. Take the follow-up quiz to test your understanding 16