/introduction/newsletter_archive/goodiestogo/article.php/3477071/Goodies-to-Go-tmbrJanuary-12-2004---Newsletter-267.htm Goodies to Go (tm)<br> January 12, 2004-- Newsletter #267

Goodies to Go (tm)
January 12, 2004-- Newsletter #267

By Vince Barnes

Goodies to Go (tm)
January 12, 2004--Newsletter #267

This newsletter is part of the internet.com network.

Featured this week:

* Goodies Thoughts - A Walk Through History
* Q & A Goodies
* News Goodies
* Goodies Peer Reviews
* Feedback Goodies  
* Windows Tech Goodies  
* And Remember This...



Goodies Announcement

The new Beyond HTML Goodies book is now available!


Go beyond the basics and learn how the pros add and use dynamic HTML features and advanced JavaScript techniques. Beyond HTML Goodies demonstrates dozens of new and different features readers can add to their existing Web pages using HTML and JavaScript. The book starts with simple text and image tips, such as adding a clock to a Web page or causing text to appear when the mouse moves over an image. It gradually builds to more complex tricks, including manipulating forms or working with cookies behind the scenes. Throughout the book, readers enjoy Joe's snappy style and "to the point" discussion of each "goody" in the book.





Goodies Thoughts - A Walk Through History

History has to be one of the most fascinating subjects available for us to study. I love hearing stories that my friends tell me about things that have happened to them, and history is just a much grander version of the same thing. It's the story of things that happened to my ancestors and their friends (as well as those who may not have been so friendly!) All of which may be fun, but, with the exception of the history of the Web and perhaps websites about history, it doesn't have much to do with web design!

There is some history which does, however, and several of you have asked about it. When you open your browser and surf through a few sites, the browser keeps track of where you have been so that you can go back there by using either the "back" button or other navigation techniques the browser may provide. To keep track, the browser builds a history file. This file is just a series of links to the URLs you have visited. In the Internet Explorer (I'm looking at version 6) you can view the contents of the history file either by clicking the history button on the toolbar, by pressing ctrl-h, by selecting View/Explorer Bar/History from the menu hierarchy or by clicking the little down arrow to the right of the "Back" button. Once you have the history displayed, you can click on any link the revisit that page.

Wouldn't it be nice if you could provide some access to your visitor's history from within your page? With JavaScript, you can! JavaScript includes a "history" object. You can use this object to replicate the functions of the browser's "Back" and "Forward" buttons. Here's an example:

<script language="javascript"></script>
<form name="form1">
<input type="button" name="button1"
value="Go Back 2 Pages"

In this example, I have created a form which contains a single button. I have set the "onclick" event to use the "go()" method of the "history" object to move back two pages.

The history object also includes "back()" and "forward()" methods to move back and forward single pages. Of course, before you could move forward, you would have to have moved at least one page backwards. The "go()' method accepts a number parameter which can be either positive or negative and moves you forward or backward (respectively) the specified number of pages, as shown in the above example. You can use the history object's "length" property to find the length of the history list in the browser.

It's easiest to think of uses for the back method, but with some thought you could develop some interesting navigation techniques in your site by using a combination of these methods.

There are also a couple of interesting tricks using the history object. If the index (the number parameter) of the "go()" method is set to zero like this:
then the current page would be reloaded. You could also set the index by using something typed in by the user. The following would use a text field they enter a value into:

If you want to do something like this you would have to be mindful of the types of things a user could enter into the text box. Some of them may not be too useful for your go() instruction! You could use a selection list to limit the choices -- as a programmer you always have to be on your toes!


Thanks for Reading!

- Vince Barnes



Q & A Goodies

Questions are taken from submissions to our Community Mentors. You can ask a Mentor a question by going to http://www.htmlgoodies.com/mentors.

Q. I am fairly new to website design and need to design a site in FrontPage 2002 to sell a book. The book will be sent as an e-mail attachment after customer has paid through our merchant account. The order form when the website is set up will go through to our bank merchant account on a secure server and the e-mail should be automatically attached. Could you direct me to a tutorial somewhere that gives me information on how to do this?

A. I would buy a pre-bulit e-commerce application to handle this for you. There are many out there, but it depends on what your server will support. I use Active Server Pages(ASP). It runs on Windows servers. I also use a shopping cart called VASP (www.vasp.com) and it handles exactly what you are looking for. Others do also but I am familiar with that one and can tell you that it is a very nice cart for the money. Another I would suggest and is a bit cheaper is ClickCart (http://www.clicktech.com). This one I believe handles eBooks but I am not 100% sure. Send an email to the Leo, the owner and I am sure he can answer your questions.

Q. I'm making a website with a "fixed" background. I can't figure out how to make the picture fit the browser perfectly on everybody's system. Is there a code I can place inside my document to alter the fixed background to fit the browser? My site content will go into a smaller screen/box within the background so there is no need for scrollers on my outside browser and my background image doesn't need to be tiled because it basically is my site.

A. You can use Cascading Style Sheets to fix a background image. The code would have to be edited for your particular situation and image but here is the code:
<style type="text/css">
body {
background-image: url("/images/your_image_name.gif");
background-repeat: no-repeat;
background-attachment: fixed

Q. I am trying to figure out how to make a check box on an HTML form checked by default.

If you want a check box to be checked when the page opens you can do it without JavaScript like this:
<input type="checkbox" id="ckbox" checked>
With JavaScript you can set the checked property to true when the page loads like this:
<script type="text/javascript">
The above will work if there is only one checkbox. If you have multiple checkbox's with the same name then you have to specify itslocation in the array like this:
<script type="text/javascript">
The above would set the first checkbox's checked property to true.

Q. I am looking for JavaScript help in order to pre-select a option in a select field inside a form. I am using server-side scripting (PHP) in order to provide the selected value.

A. You could use PHP to create your option tag and select the option you want that way. I have a small Help Desk application written in PHP that I have set up dropdowns to select the date. I have them default to the current date. Here is an example of the dropdown for the
<select name="beg_req_month">
{print "<option value='" . $i . "' selected>" . $i .
{print "<option value='" . $i . "'>" . $i . "</option>\n";}
The variable $prob_month is set to the current month in some previous code. For JavaScript to set the selected option you would use a statement like this (which sets the first option tag to selected):
[Beware of the period following the less than symbol in the "for" statement above -- this is one of the periods inserted as a part of the technique mentioned in the note at the beginning of this section & does not belong in the code you execute -- Ed.]

Q. Is it possible to change the link color with the onMouseOver command?

A. Yes it is. I have done it using JavaScript (there is also a way using CSS). Here is my JavaScript version:
<title>Change Link Color</title>
<style type="text/css">
/* Set colors for IE5.0+ and Netscape 6.0 */
.textRed {color:red}
.textBlue {color:blue}
.textLgreen {color:lightgreen}
/* Set colors for Netscape 4.0+ */
/* No underline on link for all browsers */
/* This script was written by Jim Young of www.requestcode.com and has been tested in Internet Explorer 5.0+, Netscape 4.0+ and Netscape 6.0. I use the statement (this.className) to change the class for the links in NS6 and IE5.0+ . The scripts below are strictly for NS4.0+ . Add links below that are in the same order as your links in the body section. the format for the array is:
page to link to, the link name(what is displayed on your page), div id, class(color) for the mouseover, and class(color) for the mouseout.
Make sure you separate them by a comma (,).
var links = new Array()
links[0]="http://www.wsabstract.com,Website Abstraction,divLink0,over,normal"
links[1] ="http://www.requestcode.com,Requestcode,divLink1,overb,normal"
// Unless you absolutely have to DO NOT change the functions below.
function change(linknum)
if(document.layers) // Check for NS4.0+
linkval=links[linknum].split(",") // split out the values
var linkd="<A HREF="+linkpage+" CLASS="+linkclass+" onMouseOut=changeb(\""+linknum+"\")>"+linkname+"</A>"
var docwrta="document."+linkdiv+".document.write('"+linkd+"')"
function changeb(linknum)
var linkd="<A HREF="+linkpage+" CLASS="+linkclass+"
onMouseOver=change(\""+linknum+"\") onMouseOut=changeb(\""+linknum+"\")
var docwrta="document."+linkdiv+".document.write('"+linkd+"')"
/* If you add more links here make sure you update the links array with the same url and other required information. Make sure they are entered in the array in the same order as they appear on your page. Also remember to change the value being passed on the mouseover and mouseout to the functions to match the entry in the array. Make sure you use different names for each div. In the mouseover for IE and NS6 you can change the class name specified by the statement this.className to a color you have setup in the styles area in your head section above. You should leave the class(color) for the mouseout the same as when your link is displayed when the page is first loaded. I currently have them set to blue which is the class normal.
<H1>Link Effect Example</H1>
Run your mouse over the links to see them change color </CENTER> <div id="divLink0" style="left:15; position:absolute; top:90; visibility:visible">
<a href="http://www.wsabstract.com" onMouseOver="change ('0');this.className='textRed'" class="normal" onMouseOut="changeb ('0');this.className='textBlue'">Website Abstraction</a> </div> <div id="divLink1" style="left:15; position:absolute; top:120;
<a href="http://www.requestcode.com" onMouseOver="change ('1');this.className='textLgreen'" class="normal" onMouseOut="changeb ('1');this.className='textBlue'">Requestcode</a>






News Goodies

IBM Puts Extra Barbs in 'Stinger' for LinuxWorld
[January 12, 2004] Big Blue preps new partition features for its forthcoming database software, which will be demonstrated at LinuxWorld next week.

Click here to read the article



Buffer Overflow Plugged in Sun ONE Web Server
[January 12, 2004] Sun releases service pack to fix denial-of-service vulnerability.

Click here to read the article



Intel Chips in For Linux Defense
[January 12, 2004] UPDATE: The No. 1 chipmaker puts its money behind Big Blue and an OSDL-backed fund to defend any suits related to the SCO/IBM dispute over Linux code.

Click here to read the article



MySQL Eyes Enterprise with 5.0 Alpha
[January 12, 2004] New database version will help MySQL compete more effectively with powerhouse players such as Microsoft IBM and Oracle.

Click here to read the article



Habla Interactive?
[January 12, 2004] Online Hispanic publishers unite to push their collective agenda with advertisers.

Click here to read the article



VERITAS Automates Disaster Recovery Software
[January 12, 2004] Latest Bare Metal Restore automates server recovery, bringing systems back online faster.

Click here to read the article



The Marketing of Can Spam
[January 12, 2004] The Can Spam Act becomes the latest marketing tool for companies selling e-mail related products and services.

Click here to read the article


Lindows Takes a Hit in Battle Against Microsoft
[January 9, 2004] A San Francisco Court halts efforts by the firm to hand out customer rebates in the name of open source.

Click here to read the article



FTC Wins Judgment Against Net Auction Scammers
[January 9, 2004] Court bars two Chicago area residents from participating in Web auctions and orders more than $90,000 in consumer redress.

Click here to read the article



Apple's Silent Push Into Enterprise
[January 9, 2004] Leave it to the Macintosh maker to make server and storage sexy and affordable. So why aren't these guys tooting their own horn?

Click here to read the article






Goodies Peer Reviews


Every week a site is selected for review. Each week, reviews of the previous week's selected site are chosen for publication on the HTML Goodies website.


The current week's selected site is published in Goodies To Go and in the Peer Reviews section of the website.  Current contact email addresses for submitting your site and for submitting reviews are published in Goodies To Go.

If you would like to have your site reviewed, sign up for the Goodies To Go newsletter in the Navigation Bar on the left side of this page. 

For full details about this program, see http://www.htmlgoodies.com/peerreviews




Feedback Goodies

Did you ever wish your newsletter was an easy two way communications medium? Ploof! It now is!
If you would like to comment on the newsletter or expand/improve on something you have seen in here, you can now send your input to:


We already receive a lot of email every day. This address will help us sort out those relating specifically to this newsletter from all the rest. When you send email to this address it may wind up being included in this section of the newsletter, to be shared with your fellow readers. Please don't send your questions to this address. They should be sent to our mentors: see http://www.htmlgoodies.com/mentors/

For those who are missing Peer reviews: we are once again revising the Peer review program in the hopes of creating a workable solution. The current plan is to move the new Peer Review pages into place in the new year. All those who have been selected for reviews in the past will be featured in the new pages. The new method will make it much easier for your peers to provide feedback and much easier for us to handle the publication side of things. "Watch this space!" It's coming soon!!

Thanks for pointing out the error in the first question in last week's Q&A. For those who wanted to get the actual answer, it's repeated as the first question in this issue; this time with the corresponding answer!

Thanks again for all your feedback!



Windows Tech Goodie of the Week:


Caching Oracle Data for ASP.NET Applications


Narayan Veeramani shows how ASP.NET developers can improve application performance by caching data stored in an Oracle database and keeping the cached data in sync with the data in the Oracle database.



And Remember This . . .

On this day in...

1879 Start of the British-Zulu War

On this day in 1879 General Frederic Augustus led the British invasion of Zululand from the southern African republic of Natal. The British had controlled Natal and neighboring Zululand since 1843, when they took over from the Boers (aka Africaaners) who were the descendants of the original Dutch settlers of South Africa. Upon the death of Zulu King Mpande in 1872, Cetshwayo, his son, became King of the Zulu. Cetshwayo was determined to resist European rule of his kingdom and in December of 1878 rejected the British demand that he disband his troops. Though the British suffered several very costly defeats in battle, they prevailed by July 1880 and the Zulu were forced to surrender. The British formally annexed Zululand into Natal in 1897. In 1910 Natal became a part of the Union of South Africa.

Today was also the day that: in 1665 French mathematician Pierre de Fermat died leaving a puzzle that took 358 years to solve; 1816 the French decreed the Bonaparte family expelled forever; 1976 mystery novelist Agatha Christie died at 85; 1820 Royal Astronomical Society founded in England; 1836 Charles Darwin aboard the HMS Beagle reached Sydney Australia; 1916 Britain proclaimed the Gilbert & Ellice Islands in the South Pacific a colony; 1948 Mohandas Mahatma Gandhi began his final fast; 1952 the University of Tennessee admitted its first black student; 1968 Beatles Film Production Ltd became Apple Film Production Ltd; 1970 Biafra surrendered to Nigeria, ending the Biafran war; 1970 first commercial flight of a Boeing 747; 1989 Idi Amin was expelled from Zaire; 1991 US Congress gave George Bush (sr) authority to wage war on Iraq; 1995 earthquake killed 5000+ in Kobe, Japan; 1995 O.J. Simpson murder trial began in Los Angeles;

Born today were: in 1588 first Governor of the Massachusetts Bay Colony John Winthrop; 1737 first signer of the US Declaration of Independence John Hancock; 1856 painter John Singer Sargent; 1876 author Jack London; 1893 Reichsmarshall and Nazi propoganda minister Hermann Goering; 1902 Saudi King Ibn Abdul-Aziz Al Saud; 1906 comedian Henny Youngman; 1933 British talk show host Michael Aspel; 1935 mentalist "The Amazing" Kreskin; 1941 English blues singer Long John Baldry; 1944 heavyweight boxer Joe Frazier; 1951 actress Kirstie Alley; 1952 conservative talk show host Rush Hudson Limbaugh; 1954 radio and TV personality Howard Stern; 1974 singer ("Sporty Spice") Melanie Jayne Chisholm;

Thanks for reading Goodies to Go!


Archive Home Page.

  • Web Development Newsletter Signup

    Invalid email
    You have successfuly registered to our newsletter.
Thanks for your registration, follow us on our social networks to keep up-to-date