CIS 757 Distance Education QUIZ -06

Prof. Auciello's Virtual Classroom Quiz

Last.First Name:

CIS 757 QUIZ 06 PROF. AUCIELLO

EXPLANATION:

          This goals of this lesson are:

          Understand Slide Show in JavaScript (JS).
          Speed of JS vs Java.
          Speed control (passing paramters)
          Use of style.
          INSERTING SCRIPT ANYWHERE.
          ARRAYS.
          FUNCTIONS.
          ADDRESSING CONVENTIONS.
          JAVASCRIPT HELP / INFORMATION ON WEB.

Cite your source of information: Name of book,
link, e.g., http://wp.netscape.com/assist/net_sites/bg/ ,
help sheet or other ....
This quiz is intended to sharpen your research skills.

Q001: EXPLAIN THESE LINES:

<HTML> <HEAD> <TITLE>549 index page</TITLE> ( I will do these for you as a starter. Number each line.)
1. Begins html file.
2. Starts HEAD Label.
3. Puts Title on top of Web Page.

 

Q002: EXPLAIN THESE LINES:

<SCRIPT LANGUAGE="JavaScript"> var speed = 1800; // initialized. <br> function Scrollon() { speed = document.forms[0].boxtext1.value; // this is key: the contents of boxtext1 // are assigned to 'speed' timer = setTimeout("Scrollon()",speed) ; }


Q003:

var Pic = new Array() // don't touch this DEFINING AN ARRAY if (Pic[0] != 'r01.jpg') // LOAD IF NOT ALREADY LOADED. { Pic[0] = 'r01.jpg' // LOADING ARRAY W. NAMES OF IMAGES! Pic[1] = 'r02.jpg' Pic[2] = 'r03.jpg' Pic[3] = 'r04.jpg'


Q004: DEFINING AND INITIALIZING VARIABLES.

var t
var j = 0 // VAR j set to 0
var p = Pic.length


Q005: Creating an array, loading it with images.
explanations should include:
(hard question: explain use of 'src')
what does 'new' do?
what is p?
     var preLoad = new Array()       // preload defined as ARRAY.   
     for (i = 0; i < p; i++)         // FROM 0 TO LENGTH OF 'PIC' ARRAY, 
         { preLoad[i] = new Image()  // preload[i] defined to contain Images. 
           preLoad[i].src = Pic[i]   // img src [array] contains the Images. 
         }  
      } //  end if    


Q006: Explain runBGSlideshow function

   
function runBGSlideShow()       // name of function.
  { if (document.body)                       // if there's a place to show slides
       { document.body.background = Pic[j];  // display image as background
         j = j + 1                           // counter
         if (j > (p-1)) j=0                  // if j = Pic.length, set j = 0
         t = setTimeout('runBGSlideShow()', speed)
                                             // delay function controlled by 'speed'
        } // end if
  } // end function


Q007: ADVANCED HTML -- look up use of "background" command.


   <style>                  
     body
       {
         background-repeat: no-repeat;         
         background-position: 10 50;    <!--  hor=10, ver=50 (upper left corner) -->
       }
   </style>   
</HEAD>


Q008: BACKGROUND COLOR, LINKS, onload command.

<BODY bgcolor= "#FFFFCC" link="#FFFFFF" vlink="#FF0000" alink="#000000" onload="runBGSlideShow(); Scrollon()"> <!-- This is very powerful: (2) functions are called! note quotes and ; (syntax). -->


Q009: EXPLAIN EVERY LINE IN TABLE AND FORM.

<TABLE border=0 cellspacing="0" width="700" align="center"> <TR> <TD WIDTH = 20%> <FORM NAME = "box" onSubmit = "Scrollon()"> Speed: <INPUT TYPE="text" NAME="boxtext1" SIZE="4" VALUE= "1500" STYLE="font-size: 8pt"> </FORM> </TD> <TD WIDTH = 80%> <H3> WELCOME TO PROF. AUCIELLO'S JavaScript SlideShow! </H3> </TD> </tr> </TABLE> </BODY> </HTML>


Q010: EVALUATION:

WRITE A SHORT PARAGRAPH --
WHAT DOES THIS PROGRAM DO. HOW IT WORKS.
WHAT YOU THINK OF IT. WHAT DID YOU LEARN. HOW TO IMPROVE IT.
HOW TO APPLY CQII (CONTINUOUS QUALITY IMPROVEMENT AND INNOVATION) TO IT.