This can be used as a face-to-face lab or as a learning activity done online.
On completion of these learning activities the student should be able to:
- Use the <script> element correctly on a web page.
- Write a custom function to be used later on the web page.
- Use the browser Console tool to trouble-shoot syntax errors.
- Use the alert( ) function to display a message to the user.
- Use the prompt( ) function with variables to get input from the user and store it in a variable.
- Use the document.write( ) to display information on the web page.
- Establish and use a consistent naming convention.
- Describe how to create a function and the correct way to call that function.
Multiple file formats included.
- Have your students view this activity on their iPads. Your downloaded zip file includes formats for PDF, ePub, and mobi (Kindle).
Use these Learning Activities as part of your Introduction to Programming courses.
*** CONTENTS ***
- Start with a Web Page
- The <script> element in the <head> section
- Write a function
- Using the Console - Naming Conventions
- Using <script> inside the <body> section
- Functions and Comments
- Using alert( )
- Using prompt( ) and document.write( )
- Commenting, Assignment Operator, and Concatenation
- How a Browser Reads a Web Page
- Things to Remember
- Complete Source Code Listing
- 28 multiple choice and T/F quiz questions included.
This learning activity was written by Peter K. Johnson from Web Explorations, LLC. It is based on 14-years of teaching web development and programming languages for both online and face-to-face learners. Web Explorations
specializes in course development.