Contents:
1 Google, calculator,
2 Favelets, scripts,
3 Netscape 2.02, isindex.
On this page you'll find some XHTML experiments. See also pages with
XHTML colours,
browser compatibility tests, codepage
characters,
some GeoURL experiments,
or visit the complete site map.
Google's free site search is nice, but the generated HTML form is far from optimal. I had to modify it anyway to get valid XHTML. If you want to modify your own customized site search form, here are some details:
#bbbbbb
background, while GL:0 (the default) is white, and GL:2
is black. I'd need #cccccc
to match BGC:#cccccc,
but white is also okay.
Query string | Simple | Customized |
---|---|---|
99 inches in rods | ![]() |
![]() |
2 stones in oz | ![]() |
![]() |
12 pounds in troy oz | ![]() |
![]() |
imperial ton/35 in oz | ![]() |
![]() |
days*horsepower/psi | ![]() |
![]() |
Unfortunately nice Google features like the calculator don't work with its customized free site search. The site search URLs are very long, therefore I created a shorter PURL for my AWFID with hardwired parameters &as_qdr=y and &lr=lang_en. This results in the new customized search form for &lr= instead of any &domains= parameter.
Hint: Spaces in PURL redirections of the site search
(3rd column) are encoded as %2520 instead of the usual %20.
After the introduction of "custom search engines" the old "free site search"
is now
mostly obsolete, but some parameters like AH can be still
relevant.
I'll collect my "Googlets" including custom search engines on a separate
site hosted by Google.
Related links: Google official blog, sitemaps blog, friends newsletter.
Favelets (aka Bookmarklets) are snippets of JavaScript code in the form of a JavaScript URL. Normally JavaScript URLs, i.e. links determined by JS, are a bad idea, because they won't work in browsers without JavaScript, or if the user has disabled JS. There's also the question of the JS version, Netscape 3.x (incl. OS/2 Netscape 2.02) supports only JavaScript 1.1, and features of later JS versions throw syntax errors like hell in old browsers. Well designed web sites don't rely on scripts, frames, plugins, applets, or style sheets.
But if JS is only used as an additional option, it offers some nice features. The idea with favelets is to bookmark these links, and later apply their code on any actual document. Therefore a favelet typically does something with document.URL or window.location.href, e.g. submit it to another site for validation, or it displays or modifies document properties like document.bgColor.
JS links have the form <a href="javascript:expression">, where expression
is evaluated by JS returning void or a string (?). Apparently strings are simply displayed, to change the
location use void(location=URL).
Here's an example using Netscape's special view-source:
void(location='view-source:'+location).
And the next time somebody tries nonsense like white on white or black on black simply force a silver background. Testing a small favelet like this is easy, input its URL mocha:void(document.bgColor='silver') in the location line. Other browsers probably insist on javascript: instead of mocha:.
A tricky part with favelets is to nest the quotation marks appropriately. One level "..." is used by the href-value, i.e. the complete JS link. The second level '...' can be used for JS strings within the expression. I haven't found a clean way for more levels like XHTML attribute value strings within JS strings. A rather clumsy workaround used in document.lastModified is 'value='+unescape('%22')+document.lastModified+unescape('%22').
This was an example with more than one JS statement, a simpler solution could use function alert as in
alert(document.lastModified+unescape('%0A')+document.URL).
Please edit the title of bookmarked favelets before moving them to a subfolder, Netscape 2.02 creates but later can't manage complex titles... :-(
Use escape(location) to encode an URL as parameter of another URL like the W3C Link Checker: void(open('http://validator.w3.org/checklink?url='+escape(location))). Here void(open(URL)) instead of void(location=URL) opens a new browser window.
In Jesse's
bookmarklets I found a
nice and simple
favelet to query links to the current page listed by Google:
location='http://www.google.com/search?q=link:'+escape(location);
The source
works with many browsers, but for JS 1.1 and Netscape 3.x add
void() and maybe strip www and the trailing semicolon:
void(location='http://google.com/search?q=link:'+escape(location)).
Now I was almost ready to delete this section as "ancient history",
but it might still help in some special situations, not limited to the
Mozilla 3 community - is there anybody ot there?
ecmanaut
has posted a recipe to upload files from the command line to
google pages. The very first thing it needs
is the session cookie, and you can get it with a simple favelet:
javascript:void prompt('Cookies:',document.cookie)
Some snippets for those of us hating JavaScript and its incompatibilities, please don't forget to declare the script type for event handlers like onload in the <head> section of XHTML pages:
<meta http-equiv="Content-Script-Type" content="text/javascript" />
Get rid of foreign framesets in the <body> tag:
onload="if (parent.location != location) parent.location = location"
For external links not working with JavaScript 1.1:
onclick="return confirm('JavaScript 1.1 won'+unescape('%27')+'t work')"
General JavaScript warning, but this could annoy visitors:
onclick="alert('JavaScript enabled: external links could be unsafe')"
Replace ugly frameset enforced by foreign JS (\nsome wrapped):
onload="if (parent.location == location )
if ( confirm('Empty frameset required for JavaScript because\n
some links otherwise force a monster frameset.'))
window.location.replace('demo.html')"
Corresponding demo.html body with demo.htm frame:
<frameset rows="*,"><frame src="demo.htm" /><noframes><body>
Insert explanation for curious Lynx users and Googlebot
</body></noframes></frameset>
The frameset trick is also known as cloaking, please don't use it for normal pages. Links to other pages - i.e. not affected by the ugly frameset enforced by a foreign JavaScript - should contain a target="_top" attribute. Otherwise you would trap these pages in your frameset, and that's at least annoying and maybe even illegal.
Related links: W3C favelets, FAQ by favelets.com, Jesse's bookmarklets, Jargon Googlet.
Netscape 2.02 for OS/2 is in fact a Netscape 2.x GUI over a Mozilla 3.x engine. I have removed all Netscape 4.x links, because I don't intend to use this infamous version. Of course mozilla.org still offers its monstrous Mozilla 1.x, but it's somewhat larger than the decent 2.8 MB of a fortified Netscape 2.02 binary.
about: | mozilla | logo | ( cache | ) mocha: |
blank | plugins | rsalogo | ( image-cache | ) livescript: |
config | document | qtlogo | ( memory-cache | ) javascript: |
license | authors | ibmlogo | ( global | ) view-source:about:global |
The latter view-source:about:global apparently decodes the file netscape.hst, nice if you have forgotten to bookmark an interesting site. Netscape 2.02 doesn't know about.config, and probably only OS/2 versions support about:ibmlogo, so now is the time to hex. view an unpacked Netscape binary and... have fun ;-)
Another obscure Netscape feature is the <isindex> tag. This deprecated (obsolete) element used in the <head> section of documents was roughly equivalent to a <form action="#" > with one <input type="text" /> field sending queries to the current URL.
Normal form fields associate a name with a value resulting in a name=value parameter for the default method="get". <isindex> however knows that there is only one parameter, and sends a simplified ?value query instead of something like ?name=value . So far this is only an obsolete Mosaic feature, because it would be a pain to modify the action (query) URL with <base href="URL" />. But Netscape uses the same simplified queries for all forms with exactly one text input field, if its name is isindex.