An Algorithmic and Social Introduction to Computer Science (CSC-105 2000S)

Write a short JavaScript program and corresponding Web page using the techniques you've learned.




Write a short JavaScript program and corresponding Web page using the techniques you've learned. oh boy, this is going to be difficult since i can't cut and paste everything i already did since i'm not in mathlan. can i make some comments first though? of course i can. i always do anyways :) as you no doubt noticed, i did have lots of fun with the lab today. i love it when we do labs like that because it is so hands-on (as opposed to theoretical) and i do feel like i'm learning something useful, practical, and applicable to the real world (not that i don't enjoy the discussions we have about ethics, it's just that i agree with you that with algorithms and whatnot it's easier and more efficient to learn by doing). so much so that i almost wish we did more of that. i guess that's not really the intent of the class, for us to learn how to build webpages, but i just feel like it's something i could be easily proficient in (or at least more comfortable with) if i only did it more regularly. but with guidance. is there anything you would suggest me doing that would aid me in wanting to learn more about this? is there a class i could take? i don't think i'd be interested in Intro, but i'd be interested to hear what you think. i can always come in and talk to you about this too... okay, back to my question... oh, i'm so excited! i just remembered that yes i can cut and paste cause i can get the page source! i'm so glad you showed me that today!

My First JavaScript program: Make Your Own Bio (a la the dr. seuss book, all about me)

By Ivy Chang

okay, i'm done. i've also learned that though netscape allows you to copy the html, it does not allow you to copy the javascript. that part doesn't even come up. so i doubt this works, especially cause i didn't know if i could use a word other than "username," so i kept reusing it. that probably wouldn't make any sense to a computer. let me know. do we get to do more lab today? (wednesday?) hope so! Ivy


I really didn't have a clue how to make up an effect using Javascript and write it in I did some research on the internet. I found a great site that has the script codes for dozens of page aspects ready to be shared with everyone. I copied out the code for getting the background of the page to change colors to accomodate a user-entered color preference:



<!-- Original: Eric Stremming <>   -->
<!--     -->

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! -->

<!-- Begin
function test(form) {
if (form.text.value == "")
alert("What\'s your favorite color?")
else { 
// End -->


<!-- STEP TWO:  Add this code to the BODY of your HTML document  -->


<B>Please enter your favorite<BR>
color and then click the button.<BR>
<input type="text" name="text">
<input type="button" name="button" value="click for color!" 

<font face="arial, helvetica" size="-2">Free JavaScripts provided<br>
by <a href="">The JavaScript Source</a></font>

<!-- Script Size:  1.06 KB  -->

This is really interesting to me, and I had fun thinking about the different things that one could do on a webpage using the codes shared from this website. The page is called The JavaScript Source and can be found at There are so many different choices, and I was really happy to find such a helpful site for designing web pages. I wish I was a genius and just knew how to make up program code, but this is the best I could do. I look forward to learning more about this today in lab--Does this cut-and-paste from public codes shared on a website really work in application? I think, if so, it opens up a lot of page design options for people who might be fairly proficient in operating a variety of computer software packages, but might not know how to do things like this on the web at the code level.

View Jae's page







<form name="sample">

<script language="javascript">

dateofbirth= prompt('What day and month were you born on?', '');

alert(Your horoscope if you were born on' + dateofbirth);


I don't know how to write the rest in JavaScript

If the date of birth is between April 22 and May 22, then return the horoscope of a Taurus. If the date of birth is between May 23 and June 23 then return the horoscope of a Cancer. Repeat this process for every day of the year.




<input type="button" value="Major League Baseball!" onClick="document.location=''">

come up when you load page:

<script language="javascript"> username = prompt('What is your name?', ''); document.status = 'A page customized for ' + username; </script>

allow user to write/create on the page:

<script language="javascript"> username = prompt('When is your birthday?', ''); document.write = 'A page customized for ' + username; </script>


Sam, Not the world's most extravagant thing, but I didn't want to do something that used just one of the lab's techniques, so I used two--I included notes in the document itself. It's simple, but does its job. I'll try to put everything in here, but since I'm not sure how your e-mail program likes that, I'll send an attached copy as well. Kevin Question 23 Write a short JavaScript program and corresponding Web page using the techniques you've learned.

Kevin's Program


Liz's can be found at


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

Source text last modified Wed Feb 16 08:16:00 2000.

This page generated on Wed Mar 1 09:18:52 2000 by Siteweaver. Validate this page's HTML.

Contact our webmaster at