reptile7's JavaScript blog
Sunday, August 29, 2021
Summer 2021 Updates
Blog Entry #416

We will return to our Super Calculator discourse shortly, but we have some administrative business to deal with first...

The new and unimproved HTML Goodies

A few months ago - on or about 1 May - the HTML Goodies site was redesigned; I don't know if the current HTML Goodies owner, TechnologyAdvice, did the redesigning or not.

Some quick HTML Goodies JavaScript history before we go any further:
• The introductory JavaScript Primers were in place in late 1998.
• The JavaScript Script Tip series ended in mid-2000.
(A final "Post the Tables" tip was posted externally on 31 August 2000.)
The Beyond HTML : JavaScript sector was a work in progress when I began blogging in March 2005, and remained so as its own entity, adding and removing tutorials over the years, until the recent redesign.
The JavaScript Keyword References came on line with a 15 February 2005 site redesign.
• Most recently, the JavaScript Frameworks sector got going in July 2011.

The new HTML Goodies features a single Javascript (sic) sector that provides links to about 550 pages of content, not all of which is JavaScript-related. The /javascript/ page displays eight links in a <div> at a time; it is necessary to repeatedly click a button below the div to load successive sets of links into the div. The links run in roughly reverse chronological order although things get a bit chaotic upon hitting the pre-2003 Joe Burns-era material about two-thirds of the way in.
N.B. For tutorials that run longer than one page, only the first page remains, e.g., "How to Create a JavaScript Animation", see the intact tutorial here.

Significantly, the resources of the Javascript and other site sectors have all been given new URLs; as a result, most of this blog's many links to HTML Goodies pages are now dead. The interpage links at the site's portal pages - "HTML Goodies – The Master Page", "JavaScript Primers – Table of Contents", the Script Tips index, etc. - are similarly kaput. Wunderbar, eh? As you can imagine, this sort of thing really makes my day.

In fairness to TechnologyAdvice, I should point out that the site URLs were changed with the aforementioned 15 February 2005 redesign as well.
Consider the JavaScript Primer(s) #1, whose original URL was;
on 15 February 2005 its URL changed to
whereas today its URL is
Ideally, the site URLs would not have changed in 2005; moreover, I'll concede that javascript-primers-1 is a much better file identifier than 3478211 is. Having said this, I think that TechnologyAdvice should have stuck with the 15 February 2005 URLs as they had been in use for more than fifteen years.

Support directory notes:
The /legacy/beyond/javascript/ directory
holding code and demos for the Script Tips and for the pre-2003 Beyond HTML : JavaScript tutorials
is still live as of this writing.
The /img/ directory
holding images plus some code (mostly .js scripts) and the odd demo
is gone.

Java/JavaScript Goodies, the Internet Archive, and .txt scripts

In the last few months of 2013
I concluded my coverage of the JavaScript material at HTML Goodies
and started work on the Java Goodies JavaScript Repository that Joe Burns curated in the late 1990s.
The Java Goodies project was originally an part of HTML Goodies but at some point in 1998 was spun off as a separate site. Joe pulled the plug on Java Goodies/ in late 1999/early 2000, although most of the repository content is still accessible via the Internet Archive. Format-wise, the Java Goodies script code pages are in most cases plain-text .txt files.

Nearly all of the Java Goodies scripts also appear in the online Appendix D companion to the JavaScript Goodies book that Joe wrote with Andree Growney. The collection of scripts used to be part of the live HTML Goodies site, but the /JSBook/ directory was dropped with the 1 May 2021 redesign.

Some of the Java Goodies scripts were not 'crawled' by the Internet Archive way back when but were present in the Appendix D collection, and I would link to the latter as appropriate. In 2016 or 2017, extraneous HTML started showing up in the Java Goodies scripts - I doubt that this was a gradual process, but I can't tell you exactly how it played out as it happened while I was repairing the blog potholes caused by my severing ties with EarthLink (see here, here, here, and here) - anyway, it was no longer possible to  Select All    ⌘A  and  Copy          ⌘C  the original, unadulterated scripts at the archived as it was at the live /JSBook/ directory, so I left the former behind and subsequently worked from the latter.

As noted a moment ago, however, those JavaScript Goodies scripts aren't live any longer; like their Java Goodies counterparts, they can be accessed via the Internet Archive and are now defiled with extraneous HTML. But wait ... as it happens, a very few of these scripts do appear as they should appear - you see only the script code plus an overlying Internet Archive navigation widget at the top of the page, and nothing else - so I decided to take a closer look at them in order to figure out what was going on rendering-wise.

One of the displays-as-it-should scripts is the "How Many Days Until Christmas?" xmas.txt script that we discussed in Blog Entry #308. Check over the crawl page and its underlying source. (Actually, a .txt page shouldn't have a separate source like an .html page does, but leave that aside for the time being.) The source <body> features a <div>/<table> structure that codes the aforementioned navigation widget.

The Internet Archive's navigation widget for the page

What you won't see in the source is the original "How Many Days Until Christmas?" script code; in practice, the script code on the crawl page comes from an external page (view it here) that is fetched and framed by an <iframe id="playback" ...>. (Maybe I'm missing something, but I see no need to externalize the script code given that the navigation widget has a fixed positioning.)

Anything else? Filling things out, the source also sports
a couple of <link>s to external style sheets,
seven <script>s (some with inline code, some that point to .js files) spread across the <head> and <body>, and
five <!-- comments -->s that annotate the navigation widget.

That the crawl page is a .txt document is significant
in that if we were viewing it on the desktop we would see
the navigation widget code rather than the navigation widget itself,
the playback iframe code rather than the "How Many Days Until Christmas?" script code, and
the aforedetailed <link>s, <script>s, and <!-- comments -->s.
At the Internet Archive, however, we see the crawl page as an HTML document, its .txt extension notwithstanding, because it is served to us with a text/html Content-Type, as can be confirmed by running the crawl page URL through Rex Swain's HTTP Viewer.

In contrast, check out the 8 October 1999 crawl page that I linked to for the "Make Me A Password" script that we discussed in Blog Entry #305: this page is served to us with a text/plain Content-Type, as one would expect for a .txt file.

The original "Make Me A Password" script code is present on the aforecited /makepassword.txt crawl page (the playback iframe is gone) and is now intertwined there with the same sort of supporting code
that is present in the source of the /xmas.txt crawl page and
that would not be visible on a text/html page;
the supporting code includes code for a navigation widget that would link us to a second, 2 May 1999 /makepassword.txt crawl page if it were rendered, which it is not.

As stated above, the /makepassword.txt situation is the rule and the /xmas.txt situation is very much the exception as regards the Java/JavaScript Goodies scripts, and I don't know the reason for that. The reason may not be deliberate: maybe the Internet Archive didn't text/plain the exceptions because of a glitch of some sort. In any case, let me sum up by saying that if the Internet Archive is going to add its own HTML to a set of related .txt or other text files (or to standalone text files that have only been crawled once), then it should always serve those files as text/html files.

I can understand why Joe posted the Java Goodies scripts as .txt files rather than as .html files:
in choosing the former there was no need
to literalize < and > characters as &lt; and &gt; respectively or
to add elements (e.g., <nobr>, <br>) that preserve the formatting of the code.
Joe subsequently formed and posted the Script Tips scripts as .html files; the Internet Archive's crawls of these scripts are linked by navigation widgets and are cleanly readable - e.g., see here and here.
This brings us back to the Super Calculator script. The SC demo/description page is history, but at least it's archived history. I can't really say the same for the matching SC script code page, however; although this page is history too and has been crawled a bunch of times by the Internet Archive, the archived crawls are not clean copies of the original page but, per the /makepassword.txt example above, are adulterated with (unrendered) navigation widget code, two <link>s to style sheets, etc.

A user shouldn't have to prune away a bunch of stuff to get to a script, so perhaps I should get back into the practice of posting these scripts myself. With no further fanfare, then, here is the original supercalc script code:

I've placed the code in a textarea box

<textarea id="scTextarea" name="myTextarea" cols="" rows="" style="width:95%;height:250px;">...SC script code...</textarea>

rather than in a div as I used to do.

Textarea advantages vis-à-vis a div
On the user's part:
(1) The user can click on the textarea box and  Select All    ⌘A  the code in one go; it's not necessary to mousically select the code from start to finish.
(2) If the textarea content hasn't been readonly-ed, then the user can edit the code in place and then select and copy it, and you certainly can't do that with a div.
On my part:
(3) The textarea element's Text/#PCDATA content model* means that I don't have to convert <s to &lt;s and >s to &gt;s.
(4) White space - newlines, empty line boxes, indentation - in an external source is preserved when the source is pasted into a textarea box (however, a white-space:pre;-styled div will also preserve white space).

*Content model fallout:
(i) I can't mark up the code with the <code> element as I normally would.
(ii) Remember those &nbsp;s that push the by Tom Richardson Jr. authorship credit to the right? Left untouched, they are rendered as spaces in the textarea box just like they are on the page: to print them out as &nbsp;s in the box, it is necessary to literalize the &s, e.g., &amp;nbsp;&amp;nbsp;&amp;nbsp;...

Other supercalcs, in the name of completeness

I found a couple of slightly modified, unrelated-to-Java/JavaScript Goodies copies of the supercalc code via a relevant Google search.
- this page dates to 1998 or so, Angelfire is still around but is now owned by Lycos, check the source for the code
- adds <html> and <head> and <body> markup, adds a <title>Calculator</title>
- places the <script> just inside the <body>, which is OK, but does not delete the original </head> end tag that immediately follows the </script> end tag
- displays the code in a textarea box on the page, maybe I should do that from now on
- adds <html> markup, inserts a <head> start tag before the <script>, adds <body> markup and sets the bgcolor to #ffffff
- quotes all attribute values, tweaks a couple of numerical settings
- the two links have extraneous tppabs attributes that are set to the original href URLs (this isn't standard, it's some sort of offline browsing thing, I'm not familiar with it), they also have href attributes that point to an page that is no longer available

Powered by Blogger

Actually, reptile7's JavaScript blog is powered by Café La Llave. ;-)