reptile7's JavaScript blog
Monday, November 22, 2010
Query, EarthLink, Future
Blog Entry #197

Query string coda

Two last comments on the query string business...

(1) Q: "In the previous post, we printed out the q["Browser"] = ["Internet Explorer", "Firefox", "Opera"]; array as a definition list. What would happen with just a document.write(q); command?"

A: document.write(q); would write [object Object] to the page, and that's it (document.write(q["Browser"]); would give us an Internet Explorer,Firefox,Opera display, however).

(2) Although I felt that the "How to Use a JavaScript Query String Parser" tutorial's text could have used some (OK, a lot of) editing help, I would nonetheless say that its query string-parsing code is clearly superior to that offered by "A Quick Tutorial on JavaScript Variable Passing" or by Danny Goodman's "Passing Data Between Pages via URLs" article. In particular, neither the "JavaScript Variable Passing" tutorial nor the Goodman article anticipates the a-name-can-have-more-than-one-value situation that Joseph Myers makes a big deal out of (and rightfully so, in retrospect):

(a) Even with the modifications specified by the Walking our way across the URL subsection of Blog Entry #194, the "JavaScript Variable Passing" tutorial's query string-parsing code expects a set number of name/value pairs and is thus obviously incompatible with a uninamed group of checkboxes and/or a <select multiple> menu, which allow a given name to be paired with a variable number of values. (That said, the "JavaScript Variable Passing" code should be formulable as a loop that would take care of this problem, a task I leave to others.)

(b) Applying the Goodman article's "Listing 1" code to the Browser=Internet+Explorer&Browser=Firefox&Browser=Opera query string would produce a one-element results["Browser"] = "Opera"; array. In the first iteration of the for (i = 0; i < srchArray.length; i++) { ... } loop, results["Browser"] is set to Internet+Explorer by the results[tempArray[0]] = tempArray[1]; line, but this same line overwrites Internet+Explorer with Firefox in the loop's second iteration and overwrites Firefox with Opera in the loop's third iteration.

Another detour

In my very first blog entry, I briefly related some back-and-forth that I had had with EarthLink about an HTML reference that EarthLink had written up but was no longer available at EarthLink's Web site. In that discussion, I parenthetically commented, I’ll have more to say about EarthLink, my ISP, and instructional material relating to the Web at a later time. Well, something has happened recently that gives me the excuse to finally follow through on this promise.

Since at least 1998, EarthLink has published an "eLink" newsletter comprising a grab bag of various Web-related features. The most recent issue of eLink is posted here; its "Web Watch" section sports a "Learn Web Tech from the Best" feature whose copy reads:
Learning the Web? Take a refresher or start from scratch
W3C are the people who decide the standards for Web pages and browsers (like HTML and CSS). For free tutorials and info, they're the ones to beat, and their "school" is built for everyone from beginners to pros who want to fill in the gaps.
There is a not-so-little problem here: the feature's Learn Web Tech from the Best heading link and its concluding Learn more link point to, the homepage of W3Schools. A one-minute visit to Wikipedia reveals that W3Schools has no affiliation with the W3C; more specifically, the W3C is co-based in the U.S., France, Japan, and China, whereas W3Schools is run by a Norwegian company. (I'm a bit surprised that the W3C hasn't taken legal action against W3Schools to force it to change its name, but perhaps when you're the W3C you don't feel the need to stoop to that sort of thing.)

Now, I can see how an organization like the American Chemical Society might confuse the W3C and W3Schools, but EarthLink? Oh dear. But let me tell you what really gets my goat about this.

Once upon a time EarthLink promoted the creation of Web pages as a Web community activity. The "Using the Internet" sector of EarthLink's Web site contained a "Web Site Workshop" devoted to this end; relatedly, EarthLink's bLink magazine offered HTML-related tutorials on a semi-regular basis. EarthLink even ran for its members an annual homepage contest whose grand prize was a trip for two to a tropical paradise.

Sadly, all of this has fallen by the wayside. The Using the Internet sector and its Web Site Workshop were jettisoned at the end of 2002 (EarthLink's current customer support site is a mere shadow of these materials); bLink and the homepage contest were terminated at the end of 2001. EarthLink does at least still offer a Web site builder* whose Flash demo reassuringly informs us - hip hip hooray! - "No need to learn HTML or graphic design."
*At present, EarthLink's "Site Builder" widget states: The EarthLink Sitebuilder feature has been discontinued for new users as of August 22, 2011.

Why would anyone cook at home when they could just eat out at a restaurant? Why would anyone take up gardening as a hobby when they could just buy vegetables at a grocery store? Why would anyone learn HTML when they could just use an HTML editor? Give me convenience, or give me death! But seriously, folks, human nature being what it is, I'm sure there are some EarthLink members out there who, in a spirit of DIY craftsmanship, are ready, willing, and able to get their fingernails dirty with the details of hand-coding a Web page, and it bugs me that EarthLink has apparently lost interest in catering to them.

Let me get off my soapbox and give you some relevant references:

• Go here to check out a representative bLink issue.

• The "Quick HTML Tag Reference" that triggered all of this can be viewed here; its first-page links to .pdf versions of its pages are live as of this writing. I no longer have a need for this reference, nor would I make use of it if I were teaching an 'HTML 101' course, but there you have it.

• My first blog entry also name-checks a "The ABCs of HTML" bLink article, which can be read here.

• Go here for a 2001 taste of the EarthLink homepage contest.

• The Using the Internet sector and its Web Site Workshop in mostly intact form can still be explored here.

• Adding insult to injury, the April/May 1997 issue of bLink contained an "HTML: It's Not Rocket Science" article - read it here.

• BTW, there are even a few JavaScript-themed articles lurking in the bLink archives - check this out.

All of the above links come courtesy of the Internet Archive and its "Wayback Machine", a resource I was unfamiliar with when I began blogging.

Finally, I wouldn't want this section to imply that there isn't a lot of good instructional material at W3Schools - there certainly is (indeed, the W3C links to W3Schools on its CSS articles and tutorials page nope, that link isn't there anymore) - but for bona fide W3C HTML/CSS tutorials, see:
(1) "Getting started with HTML"
(2) "More advanced [HTML] features"
(3) "Adding a touch of style"
(4) "Starting with HTML + CSS"

What's next?

At this point in time, we have discussed most of the HTML Goodies Beyond HTML : JavaScript sector tutorials that Joe Burns put together during 1999-2002. Some thirty-odd tutorials have been added to the sector in the last few years (as far as I am aware, Joe left HTML Goodies in 2002 - the Internet Archive shows no change in the sector from August 2002 to mid-February 2005); henceforth we will cover some but not all of these newer tutorials. Let's get on with it, then: in the following entry we will check over the sector's "How to Populate Fields from New Windows Using JavaScript" tutorial.


Comments: Post a Comment

<< Home

Powered by Blogger

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