Presentation is loading. Please wait.

Presentation is loading. Please wait.

Dynamic Web Pages & JavaScript. Dynamic Web Pages Dynamic = Change Dynamic Web Pages are web pages that change. More than just moving graphics around.

Similar presentations


Presentation on theme: "Dynamic Web Pages & JavaScript. Dynamic Web Pages Dynamic = Change Dynamic Web Pages are web pages that change. More than just moving graphics around."— Presentation transcript:

1 Dynamic Web Pages & JavaScript

2 Dynamic Web Pages Dynamic = Change Dynamic Web Pages are web pages that change. More than just moving graphics around. Static = Stays the Same

3 Programming Language A language for specifying instructions that a computer can execute. Each STATEMENT in a language specifies a different thing for the computer to do.

4 Programming Languanges There are lots of different languages C++ HTML Java

5 Adding Dynamic Content to Your Website Easiest Way to add dynamic content to your website? JavaScript! Derived from Java (a programming language) to add dynamic content to a web site. How? Embed JavaScript statements into the HTML code of our website!

6 Don’t be Scurred JavaScript is designed to be simple Let’s take a look…

7 A simple JavaScript statement firstName = prompt(“What’s your name?”, “”) Document.write(“Hello “ + firstName + “, welcome to my web page.”)

8 Simple Dynamic Page Here’s a simple Web page with dynamic content note: dynamic content can be mixed with static HTML content it demonstrates two types of JavaScript statements an assignment statement that asks the user for input and stores that input a write statement that writes text into the HTML page

9 Simple Dynamic Page

10 JavaScript is a simple programming language for making dynamic Web pages, i.e., pages that can interact with the user and vary each time they are loaded.

11 JavaScript code can be embedded inside the BODY of an HTML document, enclosed by the tags and.

12 The simplest JavaScript statement is a document.write statement, which displays text in the Web page. The displayed text can be formatted using HTML tags.

13 The JavaScript function prompt can be used to read a value from the user via a dialog box. The function takes two inputs, a prompt message and a default value, and returns the value entered by the user (or the default value if they don't enter anything).

14 Old MacDonald this page prompts the user for the animal and sound ("cow" and "moo", by default), then displays a verse using those values tags are embedded to break the output onto separate lines

15 Old MacDonald

16 A variable is a name that is used to represent some unspecified value in an expression.

17 In JavaScript, a variable name can be any sequence of letters, digits, and underscores starting with a letter. Since JavaScript is case-sensitive, capitalization matters.

18 Each variable stores its value. A value is assigned to a variable

19 What’s Next? FUN WITH JavaScript Assignment Explore on your own Search for JavaScript on the web Many Many Sites that give away code… Paste this into your HTML tab of FrontPage.


Download ppt "Dynamic Web Pages & JavaScript. Dynamic Web Pages Dynamic = Change Dynamic Web Pages are web pages that change. More than just moving graphics around."

Similar presentations


Ads by Google