All pastes #393590 Raw Edit

Miscellany

public javascript v1 · immutable
·published 2007-03-13 18:09 UTC
rendered paste body
// Make the HW drop down menu use javascript.  (noscript alternative is already up)function activate{	// original code by Bill Trefzger 12/12/96	// http://www.yourhtmlsource.com/javascript/scripts/dropdownlinkbox.html		if (document.hwchoose.hw_menu.options[document.hwchoose.hw_menu.selectedIndex].value != "none") 	{		location = document.hwchoose.hw_menu.options[document.hwchoose.hw_menu.selectedIndex].value;	}}function thedrop{/* How this should be:<form><p><select><option></option><option></option><option></option><option></option><option></option><option></option><option></option><option></option><option></option><option></option><option></option></select><input></p></form>*/	tag_form = document.createElement("form");	tag_form.name = "hwchoose";	tag_form.action = "";		tag_p = document.createElement("p"); // In place to allow <select> & <input>		tag_sel = document.createElement("select");	tag_sel.name = "hw_menu";	tag_sel.size = 1;			tag_op00 = document.createElement("option");	tag_op00.value = "none";	tag_op00.selected = "selected";	tag_op00.appendChild(document.createTextNode("---------Assignments---------"));		tag_op01 = document.createElement("option");	tag_op01.value = "hw/hw01.doc";	tag_op01.appendChild(document.createTextNode("HW01-Get online"));		tag_op02 = document.createElement("option");	tag_op02.value = "hw/hw02.html";	tag_op02.appendChild(document.createTextNode("HW02-Visit Web Site"));		tag_op03 = document.createElement("option");	tag_op03.value = "hw/hw03.html";	tag_op03.appendChild(document.createTextNode("HW03-Computer Store"));	tag_op04 = document.createElement("option");	tag_op04.value = "hw/hw04.html";	tag_op04.appendChild(document.createTextNode("HW04-Important Data"));	tag_op05 = document.createElement("option");	tag_op05.value = "hw/hw05.html";	tag_op05.appendChild(document.createTextNode("HW05-Monopoly"));	tag_op06 = document.createElement("option");	tag_op06.value = "hw/hw06.html";	tag_op06.appendChild(document.createTextNode("HW06-Data Compression"));	tag_op07 = document.createElement("option");	tag_op07.value = "hw/hw07.html";	tag_op07.appendChild(document.createTextNode("HW07-Web Addresses"));	tag_op08 = document.createElement("option");	tag_op08.value = "hw/hw08.html";	tag_op08.appendChild(document.createTextNode("HW08-Metaphors"));	tag_op09 = document.createElement("option");	tag_op09.value = "hw/hw09.html";	tag_op09.appendChild(document.createTextNode("HW09-Car trip"));	tag_op10 = document.createElement("option");	tag_op10.value = "hw/hw10.html";	tag_op10.appendChild(document.createTextNode("HW10-Law Suit"));		tag_sel.appendChild(tag_op00);	tag_sel.appendChild(tag_op01);	tag_sel.appendChild(tag_op02);	tag_sel.appendChild(tag_op03);	tag_sel.appendChild(tag_op04);	tag_sel.appendChild(tag_op05);	tag_sel.appendChild(tag_op06);	tag_sel.appendChild(tag_op07);	tag_sel.appendChild(tag_op08);	tag_sel.appendChild(tag_op09);	tag_sel.appendChild(tag_op10);		tag_p.appendChild(tag_sel);			tag_butn = document.createElement("input");	tag_butn.type = "button";	tag_butn.value = "Go";	tag_butn.onclick = "activate()";		tag_p.appendChild(tag_butn);		tag_form.appendChild(tag_p);		document.body.appendChild(tag_form);}window.onload = thedrop;