Web Design

This is a site of very practical information to increase the quality of your web sites and efforts. It is divided into these sections:

Other sites

JavaScript

Sharing code

In many cases, you will have the same piece of JavaScript on every page in your site. If you wish to have this code cacheable (c.f. IRCache Project) between pages, there are a couple techniques available.

Unfortunately, HTML does not define a tag to include other HTML sources into the current one (like the #include token in C like languages). However, if your site is framed, you can put your JavaScript into the top frame (the one defining the <FRAMESET>s) and refer to those functions by preceding their names with top..

For instance, the code:
if (myfunction(4) eq true)
would become
if (top.myfunction(4) eq true)
and myfunction itself would be transplanted from the file it was in previously to the parent frame's file.

If you aren't using frames, consider making every page a framed page with the code in a second, essentially invisible frame. Rename each file to a new name and create a new file with the original name that simply specifies two frames, one containing the newly named file and one containing the file with your scripts in it. For example, you may start with:

You would first create a file scripts.html that contains all your scripts (and remove them from their original source files) named, for example, scripts.html. You then rename index.html to frame_index.html and create a new index.html containing the original <HEAD> section and:
<FRAMESET *,1>
  <FRAME NAME="main" SRC="_index.html">
  <FRAME NAME="scripts" SRC="scripts.html">
</FRAMESET>

Users navigating your site wouldn't even notice the frames as each page has its own frameset (and thus the URL on their titlebar changes as they click links) but the scripts remain in their browser cache and each page loads that much faster for them. All links inside these now-framed pages would need to have TARGET="_top" added to them so as to not load a frame inside a frame and the script references would need to be changed as above. In this case however, they would be top.scripts.scriptname(...) instead of top.scriptname(...).

Long Term Goals

Part of peoples' fascination with the world wide web comes from how fast it has grown. In the early 1990's, it barely existed. Now just prior to the year 2000, it has become a phenomenal ressource with billions (as a conservative number) of websites.

The longevity of your website depends on several factors that are quite often ignored. This is not a comprehensive but rather a selective list of items.

Legibility

Believe it or not, some people will visit your website and it will be illegible either because of the obscure font that looks good to you but doesn't work right on their system or because of the font size or screen resolution you're used to. Here are some links describing what you can do:

Ability to receive feedback

If a page is to be well maintained and relate to the readers at all, it must have a feedback E-mail address posted on the page. This should most likely be in an <address> tag, at the very end of the page. Without such an address, users will be unable to report bad links, outdated information, slow images, etc.

There may be downfalls to doing this (such as the potential for spammers to collect the E-mail address), but the benefits to your own site and to the web community far outweigh them.

Searchability

The information on your site must be searchable. People must be able to find that information by looking in a search engine for certain key words. What are some of the hinderances to this? The most prominent would be sites that use images for the entire content, rather than text (as an easy way out of doing good layout).

Simplicity

If you have a complex page, you probably just need to distribute the data better across multiple pages.

Bookmarkability

If your site uses posted forms or some script lookup system to generate pages on the fly, make sure that a user can bookmark the results and have them be the same a few weeks later. Wired magazine is good at this.

Cachability

If your site isn't cachable, it will be much slower than other popular sites that are. These are some common mistakes made and misconceptions:


This page Copyright © 1995 ... 2016, Michael T. Babcock.
It was last updated on the 26th of December, 2016.