Top Banner
Lecture Bells and Whistles
21

Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

Dec 19, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

Lecture

Bells and Whistles

Page 2: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

Ways to Enhance Websites

• Java Script and Java• Sound and Video• Flash• XML (Extended Markup Language• Database Connectivity• Ecommerce• Ajax – (asynchronous JavaScript and

XML),

Page 3: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

What is Java Script?

• Text-based Programming Language• Used to Enhance Websites

– Interactivity– Animation– Dynamic Content– Games– Calculations

• All “code” is run by the browser

Page 4: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

What is Java?

• Java is also a language (OOP - Object Oriented Programming Language)

• Used to create “applets”– Little programs that sit on a web server– Called by the webpage– Code cannot be “stolen” – It’s compiled

• HTML only references the applet

Page 5: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

Java vs Java Script

• Java– Called by HTML from the server– Hidden Code– Quicker Execution

• Java Script – Stored in HTML (inline or internal)– Viewable Code– Slower Execution

Page 6: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

Java vs Java Script

Java Programs

Java Script

Java Script

Java Script

Page 7: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

Java Script Syntax

Internal Script:

<script language="JavaScript"> <!--

alert("Hello World!");//-->

</script>

Tells the browser we are starting some

JavaScript code to run.

Programming steps to actually

execute.Finishes the

block of code.

Page 8: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

Java Script Syntax

Inline Script:<a href="index.html"

onMouseOver="document.logo.src='Images/halloween.png'“

onMouseOut="document.logo.src='Images/logo.jpg'">

<img src="Images/logo.jpg" name="logo" border=0 alt="A Splash Of Sugar">

Event Trigger

Action to Take Parameter

Page 9: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

Java Script Syntax (cont)

Page 10: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

Java Script Syntax (cont)

• Functions (methods) – defined in the language; can also define your own

• Argument – info the function needs to process

• Event (trigger) – defined action that calls on a function

Page 11: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

Java Script Examples

1. Alert Message (before and after)2. Functions and Buttons3. Mouse-Over Image Swap4. Today’s Date

Page 12: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

Example 1 – Alert Message Before

<script language="Javascript"><!--

alert ("This is the easiest script")//-->

</script>

Page 13: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

Example 2 – Alert Message After

<html><head><script type="text/javascript">function alertUser(msg) {alert(msg);}</script></head><body onload="alertUser('Welcome to this AMAZING web page!')"><div style="text-align:center;padding:10px;"><h1>Amazing Web Page.</h1><p><a href="JavaScript:self.close();">Close</a></p></div></body></html>

Page 14: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

Example 3 – Functions & Buttons

Page 15: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

Example 4 – Mouse Over

• <a href="index.html" onMouseOver="document.logo.src='Images/sponge_bob.png'" onMouseOut="document.logo.src='Images/logo.jpg'"> <img src="Images/logo.jpg" name="logo" border="0" alt="Logo"></a>

Page 16: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

Example 5 – Today’s Date

Page 17: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

More Java Scripts

• Dynamic Drivewww.dynamicdrive.com

Page 18: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

Adding Sound

• As a Link:<a href="moo.wav“>Click here for the cow</a>

• Automatically Loading:<embed src=“moo.wav”>Variables:

hidden=“true” to hide playerloop=“1” or “-1” how many times does it play?

Page 19: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

Finding sound files

• Google• Find song and YouTube and convert

to .mp3 file– Click Share– Copy URL– Go to:

• www.youtube-mp3.org• Then……….

Page 20: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

YouTube to.mp3

• Paste link into YouTube to .mp3• Click: Convert Video• Then Download to

web-docs• Save according to

file-namingconventions:short, no spaces!

Page 21: Lecture Bells and Whistles. Ways to Enhance Websites Java Script and Java Sound and Video Flash XML (Extended Markup Language Database Connectivity Ecommerce.

Adding Video

• Google YouTube• Click Embed

• Copy and paste the <iframe> tag where you want the video