"Henry, you're never going to make it in the beekeeping business if you get this upset every time you lose a bee."
Daze of Our Lives

Javascript: Select box navigation

So, you have this form object such as the one illustrated below.

<form>
<select id="idname" class="button" size="1">
<option>Section I </option>
<option>Section II </option>
<option>Section III </option>
<option>Section IV </option>
<option>Section V </option>
<option>Section VI </option>
<option>Home </option>
</select>
<input class="button" onclick="selectOption('idname', URLarray)" type="button" value="Go" />
</form>

You could attach a routine written specifically for that object. Or you could initialize an array with the values for each option and call a routine that knows how to handle such an array passed to it. Here is an example of such a function named selectOption():

//generic list item function

function selectOption(ident, listItemURL)
{
var selObj = document.getElementById(ident);
var num = selObj.selectedIndex;
for (i=0; i<listItemURL.length; i++) {
if (i==num) {
top.location= baseURL + listItemURL[i];
break;
}

}
}

Somewhere before that function you’ll need to initialize an array to pass as a listItemURL parameter. Here’s an example:


var somearray1 = new Array(
'/directory/somefile1.shtml',
'/directory/somefile2.shtml',
'/directory/somefile3.shtml',
'/directory/somefile4.shtml',
'/directory/somefile5.shtml',
'/directory/somefile6.shtml',
'/index.shtml'
);

The form parameter URLarray in this case would be somearray1.

In the function, the optional variable baseURL is also initialized elsewhere, depending on the structure of the files. It is not required in this example as the values of the array in this case are based in the root directory by default. You might, however, want a base url, in which case you would declare it in a header page that would include the head portion of your shtml document. One way to do that would be as follows:



<script type="text/javascript">

var rootdir = "/";
var urlhost = location.host;
var locpath = location.pathname;
var pathtohome = locpath.substr(0, locpath.indexOf(rootdir));
var baseURL = "http://" + urlhost + pathtohome + rootdir;
document.write('<base href="' + baseURL + '" />');
</script>

This declaration would be placed before the function.

The long and short of it is you need only call one function to make a particular select box object work once you have declared an array of option values and successfully passed that array to the function.

Revising the Ubiquitous Billgatus Iconograph

The original creator of BillGatus apparently used an image capture of a video featuring the The Best of Both Worlds sequel to the of Star Trek: Next Generation episode, Q Who?, where Q had unceremoniously flung the Enterprise into a very distance and uncharted sector of the universe populated by the rather ominous borg collective, then unknown to the United Federation of Planets. The sequel sees Capt. Picard dragooned by the borg collective for the purpose of communicating their message to people on earth targeted for assimilation that “resistance is futile.”

At any rate, the size of a teevee image on a computer screen was decidedly smaller than what one normally viewed on the average telly. The result was less than spectacular but the best one could do at the time it was created.

The original version looked like this:

BillGatus 3.0

It’s a bit muddy.
Read the rest of this entry »

Blancmange.net

An olde domain that used to be the home of The Memory Hole is now adrift, but not at sea. Not to worry, as olde school ties will be maintained with links, at the side, to the latest material added to TMH

The root directory, for the longest time, simply featured a spectacular dolphin image in homage to Douglas N. Adams and his brilliant Hitchhiker’s Guide to the Galaxy radio play. It’s not entirely disappeared, residing nowadays in the sister floonet.net sphere.

Of course, Planet Skyron is the home of Mr. & Mrs. Samuel L. Brainsample, the very ordinary couple whose unusual passion for blancmange was key to Dunbar menswear shop proprietor, Angus Podgorny, becoming the only Scotsman ever to win Wimbledon. Douglas Adams didn’t have a hand in this, but contributed to the very British programme that documented it. Alas, he is no longer with us.

Here’s a recipe for blancmange for those re-enacters and otherwise anachronistic society types who’ve grown tired of doing Pearl Harbor and would rather try their hand at a pivotal moment in Wimbledon history when chief inspectors could not distinguish cannibalistic blancmange impersonators from the real article.

Blancmange

From:
Blancmange (blawnh-MAHNZH), a French favorite, is a cooked pudding that’s poured into individual ramekins and chilled. Unmolded puddings are often served with a fruit sauce or compote.

2 envelopes unflavored gelatin
4 1/2 cups 1% low-fat milk, divided
1 1/3 cups sliced almonds, toasted
1/2 cup sugar
1/4 teaspoon salt
1/4 teaspoon almond extract
8 ounces frozen fat-free whipped topping, thawed
Cooking spray

Sprinkle gelatin over 1/2 cup milk in a small bowl; set aside.
Place 4 cups milk and almonds in a blender, and process until smooth. Strain through a sieve into a medium saucepan; discard solids. Stir in sugar, salt, and extract, and bring to a boil. Add the gelatin mixture, stirring until gelatin dissolves; remove from heat.

Place pan in a large ice-filled bowl for 30 minutes or until milk mixture comes to room temperature; stir occasionally. Gently stir one-fourth of whipped topping into milk mixture; gently fold in remaining topping.

Spoon 2/3 cup milk mixture into each of 9 (6-ounce) custard cups coated with cooking spray. Cover and chill at least 4 hours or overnight. Loosen edges of blancmange with a knife or rubber spatula. Place a dessert plate upside down on top of each cup, and invert onto plates.

Yield: 9 servings

Bon appétit!