[Instructions] [Search] [Current] [News] [Syllabus] [Glance] [Links] [Handouts] [Outlines] [Labs] [Assignments] [Quizzes] [Questions] [Risks] [Examples]
Back to Introduction to JavaScript. On to Lab: Control Structures.
Held Tuesday, February 29, 2000
Overview
Today we continue our investigations of JavaScript by trying some simple hands-on activities.
Question 22 for today's class: Describe an algorithm that you think would be useful for the Web.
Question 23 for Wednesday's class: Write a short JavaScript program and corresponding Web page using the techniques you've learned.
Notes
Contents
Summary
.js files.
input tag should be
onClick="alert('...')"
input tag should be
onClick="document.status='...'"
document.location="...".
<input type="button" value="Go Home!"
onClick="document.location='http://www.math.grin.edu/'">
script tag.
<script language="javascript">
username = prompt('What is your name?', '');
document.status = 'A page customized for ' + username;
</script>
document.write.
<script language="javascript">
username = prompt('What is your name?', '');
document.write = 'A page customized for ' + username;
</script>
function functionname(inputs)
{
instructions
}
function greet()
{
username = prompt('Please enter your name:', '');
alert('Hi ' + username);
}
.js. For
example, greet.js
<script language="javascript" src="greet.js"> </script>
greet().
For example, onClick="greet()".
If you still have time left, play with the commands you've learned so far.
Saturday, 22 January 2000
Tuesday, 29 February 2000
Back to Introduction to JavaScript. On to Lab: Control Structures.
[Instructions] [Search] [Current] [News] [Syllabus] [Glance] [Links] [Handouts] [Outlines] [Labs] [Assignments] [Quizzes] [Questions] [Risks] [Examples]
Disclaimer Often, these pages were created "on the fly" with little, if any, proofreading. Any or all of the information on the pages may be incorrect. Please contact me if you notice errors.
This page may be found at http://www.math.grin.edu/~rebelsky/Courses/CS105/2000S/Outlines/outline.22.html
Source text last modified Tue Feb 29 09:52:47 2000.
This page generated on Tue Feb 29 09:55:17 2000 by Siteweaver. Validate this page's HTML.
Contact our webmaster at rebelsky@grinnell.edu