Make your own free website on Tripod.com
H-4 Web Work Assignment:

**The links will take you to Webopedia.  Its an online dictionary and search engine for computer and Internet terminology.

The assignment was to find two pages on the Web that contained scripts, print their HTML source
code, then circle and label any variables, conditionals, and functions I saw in the documents.

Well, there are a couple of problems with that:

  1. We publish all of our assignments to the Web.
  2. A Web page with just source code would look silly.
  3. I don't think my instructor would appreciate my writing on the labs computer screen.

So, I decided to try something a little different. Below I have the URL to two Web sites. Beneath each sites URL you will find a copy of a section of the source code they used to display their page. I only chose a portion of the code because placing the entire document here would have taken up to much space. The variables, conditionals, and functions I highlighted in different colors.

Be aware that the < and > tags were omitted from the code so that the code , which is normally hidden, could actually be seen.


Variable
A set of code that allows you to modify a value in one place and have it reflected instantaneously
throughout the document. Complete Definition
Conditional
Allows your script to choose one of two paths, depending on what condition you specify. Complete Definition
Function
A set of code that performs a specific task. Complete Definition



1st Web Site address: http://www.luckysurf.com/

SCRIPT
/* brtmk */
var cookie = new Image();
var cookie_click       = new Image();
cookie_click.src="fortunekookie_click.gif";
function flip()
{
if( document.images )
{
document["cookie"].src = cookie_click.src;
}
document.cookieStr.txt.value = "";
}
var value;
bName = navigator.appName;
bVer = parseInt(navigator.appVersion);
if ((bName == "Netscape" && bVer >= 4) || (bName ==
"Microsoft Internet Explorer" && bVer >= 4)) {
value = 'INPUT TYPE=HIDDEN NAME=js VALUE=1';
}
else {
value = 'INPUT TYPE=HIDDEN NAME=js VALUE=0';
}
/SCRIPT>

2nd Web Site address: http://developer.netscape.com/tech/index.html?cp=dev01ttec

SCRIPT LANGUAGE="JavaScript"

!--
var str = navigator.userAgent;
if (((str.indexOf('Mozilla/') != -1) && (str.indexOf('/2') == -1)) &&
((navigator.appName!='Microsoft Internet Explorer'))){
button0=new Image();
button1=new Image();
button2=new Image();
button3=new Image();
button4=new Image();
button5=new Image();
button6=new Image();
button7=new Image();
button8=new Image();
button9=new Image();
button10=new Image();
button11=new Image();
button12=new Image();
button13=new Image();
button14=new Image();
button15=new Image();
button16=new Image();
button17=new Image();
button18=new Image();
button19=new Image();

button0.src="/images/t_home_1.jpg";
button1.src="/images/t_home_2.jpg";
button2.src="/images/t_memb_1.gif";
button3.src="/images/t_memb_2.gif";
button4.src="/images/t_tech_1.gif";
button5.src="/images/t_tech_2.gif";
button6.src="/images/t_docs_1.gif";
button7.src="/images/t_docs_2.gif";
button8.src="/images/t_vs_1.gif";
button9.src="/images/t_vs_2.gif";
button10.src="/images/t_supp_1.gif";
button11.src="/images/t_supp_2.gif";
button12.src="/images/t_opst_1.gif";
button13.src="/images/t_opst_2.gif";
button14.src="/images/t_sc_1.gif";
button15.src="/images/t_sc_2.gif";
button16.src="/images/t_mktg_1.gif";
button17.src="/images/t_mktg_2.gif";
button18.src="/images/t_prod_1.gif";
button19.src="/images/t_prod_2.gif";
}

function switchImg(num) {
if (((str.indexOf('Mozilla/') != -1) && (str.indexOf('/2') == -1)) &&
((navigator.appName!='Microsoft Internet Explorer'))){
{
 if (num=="0") document.home.src=button0.src;
 if (num=="1") document.home.src=button1.src;
 if (num=="2") document.membership.src=button2.src;
 if (num=="3") document.membership.src=button3.src;
 if (num=="4") document.tech.src=button4.src;
 if (num=="5") document.tech.src=button5.src;
 if (num=="6") document.documentation.src=button6.src;
 if (num=="7") document.documentation.src=button7.src;
 if (num=="8") document.vs.src=button8.src;
 if (num=="9") document.vs.src=button9.src;
 if (num=="10") document.support.src=button10.src;
 if (num=="11") document.support.src=button11.src;
 if (num=="12") document.openstudio.src=button12.src;
 if (num=="13") document.openstudio.src=button13.src;
 if (num=="14") document.source.src=button14.src;
 if (num=="15") document.source.src=button15.src;
 if (num=="16") document.comarketing.src=button16.src;
 if (num=="17") document.comarketing.src=button17.src;
 if (num=="18") document.products.src=button18.src;
 if (num=="19") document.products.src=button19.src;
}
}
}
//-->
/SCRIPT>