Writing a JavaScript User-Defined Function  A function is JavaScript code written to perform certain tasks repeatedly  Built-in functions.

Slides:



Advertisements
Similar presentations
HTML Concepts and Techniques Fourth Edition Project 2 Creating and Editing a Web Page.
Advertisements

Project 8 Creating Style Sheets.
Creating and Editing a Web Page Using Inline Styles
Using Advanced Cascading Style Sheets
Chapter 5 Creating an Image Map
Creating and Editing a Web Page
Creating a Form on a Web Page
Creating a Form with Selection Menus The SELECT control creates a selection menu This control only allows the visitor to choose pre-defined choices There.
Microsoft Office 2007 PowerPoint Web Feature Creating Web Pages Using PowerPoint.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t PowerPoint Web Feature Creating a Presentation on the Web Using PowerPoint.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Word Web Feature Creating Web Pages Using Word.
HTML Comprehensive Concepts and Techniques Second Edition Project 8 Integrating JavaScript with HTML.
JavaScript 101 Lesson 5: Introduction to Events. Lesson Topics Event driven programming Events and event handlers The onClick event handler for hyperlinks.
Office 2003 Introductory Concepts and Techniques M i c r o s o f t Word Web Feature Creating Web Pages Using Word.
Creating Tables in a Web Site Using an External Style Sheet HTML5 & CSS 7 th Edition.
Creating Tables in a Web Site.  Define table elements  Describe the steps used to plan, design, and code a table  Create a borderless table to organize.
HTML Concepts and Techniques Fourth Edition Project 3 Creating Web Pages with Links, Images, and Formatted Text.
HTML Comprehensive Concepts and Techniques Third Edition Project 3 Creating Web Pages with Links, Images, and Formatted Text.
Adding an Inline Style Sheet Page without Inline Style Sheet Page with Inline Style Sheet.
HTML Concepts and Techniques Fourth Edition Project 8 Creating Style Sheets.
Creating Tables in a Web Site
HTML Comprehensive Concepts and Techniques Second Edition Project 3 Creating Tables in a Web Site.
Web Technologies Website Development Trade & Industrial Education
HTML, XHTML, and CSS Chapter 12 Creating and Using XML Documents.
Extracting the System Date  Built-in Date() object  Can be manipulated only by creating a new object instance  var variable = new object  var birthDay.
Project 1: Creating a Dreamweaver Web Page and Local Site 1 Project Objectives Add a background image Open and close panels Display and describe the Property.
1 CS 21A Beginning JavaScript Programming Project 1 Integrating JavaScript and HTML Sonny Huang.
Microsoft Office 2007 PowerPoint Web Feature Creating Web Pages Using PowerPoint.
Creating and Editing a Web Page using HTML IMED1316.
Creating and Editing a Web Page Project 2. Project Objectives Project 2: Creating and Editing a Web Page 2 Identify elements of a Web page Start Notepad.
Integrating JavaScript and HTML5 HTML5 & CSS 7 th Edition.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Excel Integration Feature Object Linking and Embedding (OLE) and Web Discussions.
HTML Concepts and Techniques Fourth Edition Project 6 Using Frames in a Web Site.
HTML, XHTML, and CSS Chapter 8 Adding Multimedia Content to Web Pages.
Adobe GoLive Edit and FTP your web pages to a web server.
HTML Concepts and Techniques Fourth Edition Project 7 Creating a Form on a Web Page.
HTML Concepts and Techniques Fourth Edition Project 12 Creating and Using XML Documents.
Creating a Form on a Web Page
1 Creating a Second Web Page This section shows you how to create the Huntington Beach Web site.
Chapter 1 Creating a Dreamweaver Web Page and Local Site
1 Introduction  Extensible Markup Language (XML) –Uses tags to describe the structure of a document –Simplifies the process of sharing information –Extensible.
1 Creating the Header Page The header frame always displays on the AHS Web site The image (screagle.gif) that will go in the header is contained on the.
HTML Comprehensive Concepts and Techniques Third Edition 2 nd Project Creating and Editing a Web Page.
HTML Concepts and Techniques Fourth Edition Project 5 Creating an Image Map.
Creating Your First Web Page – Topic: Creating a wiki, blog, image blog and podcast Click Arrow - Next Slide 1.
Using Frames in a Web Site Project 6. Project Objectives Project 6: Using Frames in a Web Site 2 Define terms related to frames Describe the steps used.
HTML Concepts and Techniques Fifth Edition Chapter 4 Creating Tables in a Web Site.
HTML Concepts and Techniques Fifth Edition Chapter 3 Creating Web Pages with Links, Images, and Formatted Text.
1 After completing this lesson, you will be able to: Get around the Internet with your browser. Connect to the Internet. Print Web pages. Save Web pages.
Creating and Editing a Web Page
Creating and Editing a Web Page Using Inline Styles
1 Creating a Menu Bar on a Secondary Web Page  It is important for visitors to be able to move easily from one page to another  You will create a menu.
1 Your Web Page title body of Web page main heading H2 heading bulleted list paragraph.
Creating Web Pages with Links, Images, and Embedded Style Sheets
JavaScript 101 Lesson 6: Introduction to Functions.
Microsoft Expression Web - Illustrated Unit A: Getting Started With Microsoft Expression Web.
XP New Perspectives on Creating Web Pages With Word Tutorial 1 1 Creating Web Pages With Word Tutorial 1.
Creating Web Pages in Word. Sharing Office Files Online Many Web pages are created using the HTML programming language. Web page editors are software.
XP Creating Web Pages with Microsoft Office
Using DHTML to Enhance Web Pages
Project 8 Creating Style Sheets.
Project 9 Creating Pop-up Windows, Adding Scrolling Messages, and Validating Forms.
Creating Tables in a Web Site Using an External Style Sheet
Using Frames in a Web Site
Creating Web Pages with Links, Images, and Formatted Text
Integrating JavaScript and HTML
Creating Tables in a Web Site
Project 5 Creating an Image Map.
Creating Frames on a Web Page
Presentation transcript:

Writing a JavaScript User-Defined Function  A function is JavaScript code written to perform certain tasks repeatedly  Built-in functions

Writing a JavaScript User-Defined Function  User-defined functions  Written by the Web developer  Functions can have data passed to it  To call a function means to have JavaScript execute the function

Entering the chngSite() User-Defined Function in the HEAD Section  Click the blank line (line 4) between the end tag and the end tag

Type and then press the ENTER key. Type <!—Hide from old browsers and then press the ENTER key

Entering the chngSite() User-Defined Function in the HEAD Section  Press the SPACEBAR four times. Type function chngSite() { and then press the ENTER key. Press the SPACEBAR eight times. Type alert(“You are about to be transported to the new site location!”) and then press the ENTER key. Press the SPACEBAR eight times. Type location = “ and then press the ENTER key. Press the SPACEBAR four times. Type } and then press the ENTER key. Type //-> and then press the ENTER key. Type and then press the ENTER key

Saving the File  Click Save on the File menu

Testing the Web Page  Click the Fun with Phonics button on the taskbar  Click the Refresh button on the browser toolbar  If you are connected to the Internet, click the OK button when the dialog box displays with the alert message  Click the Back button on the browser toolbar to return to the Fun with Phonics Web page

Printing the HTML File Using Notepad  If necessary, click the Notepad button on the taskbar. Click File on the menu bar and then point to Print

Click Print

Closing Notepad and Your Browser  Click the Close button on the browser title bar  Click the Close button on the Notepad window title bar

Summary  Discuss how to integrate JavaScript with HTML  Insert tags on a Web page  Write start and end tags  Define and use flickering to draw attention  Describe the background color property of the document object

Summary  Set the background color of a Web page using JavaScript  Save the HTML file  Test the Web page  Discuss JavaScript variables  Extract the system date  Use several variables to construct a message

Summary  Describe the write() method of the document object  Write a user-defined function that displays a message and links visitors to a new Web site  Describe how the setTimeout() method works  Use the lastModified property to display the last modified document date  Print an HTML Notepad file

What You Should Know

Project 8 Complete PLEASE REVIEW FOR EXAM!