************************************************************
Goodies to Go ™
May 30, 2005 — Newsletter # 339
************************************************************
Featured this week:
* Q & A Goodies
* News Goodies
* Feedback Goodies
* Windows Tech Goodie of the Week
* And Remember This…
This week’s newsletter is coming to you a day
later than usual. This is because yesterday (Monday, May 30, 2005 — the date
this newsletter bears) was Memorial Day in the United States, and there was no
staff in the publications office to send it out. For those of you not familiar
with this holiday, or for any of you who may be interested in an external
perspective, there is a nice, balanced description of the day written by David
Frum in Canada’s National Post (see
http://www.canada.com/national/nationalpost/news/issuesideas/story.html?id=9138344f-c907-4762-ab4a-3df9a27f500c
— although the Nation Post might not leave this piece up for too long.) You can
also learn its history at
http://www.usmemorialday.org/backgrnd.html (and as we
know, you can find out about anything on the web!)
It would make sense for the web to be utilized for memorials. We already know
that once something hits the web, you can be pretty sure it will be around for a
very long time. Even when a site is removed, there are cached copies of it all
over the place. With that in mind, I thought I’d do a quick Google and see what
I could come up with. A search on the word "memorial" produced only a little
more than 83 million hits. I haven’t read them all yet!
If you try my search, and scan over the first few pages of results, you will
find, as I did, an amazingly diverse collection of memorial related sites.
There are, of course, all the hospitals, universities and museums that have the
word in their names. In between them you’ll find some very interesting sites.
There are plenty, as you might expect, dedicated to celebrities of one sort or
another, but there are also plenty dedicated to everyday folk like you and me.
In the sponsored links there are some sites that enable people to create a
memorial for a friend or family member. There are many touching human stories
told in these sites — well worth taking a few moments to read.
When we look at the history of a few hundred years ago, it mostly involves the
actions of Kings and Queens, religious leaders and a few other powerful people.
It is almost impossible to discovery much detail of the lives of ordinary people
of the time. In our time, however, while history is still written by those in
high places, the World Wide Web and its powerful search tools provide the means
for everyday people to write their own history for the benefit of future
generations.
The www is so much more than just web pages!
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
https://www.htmlgoodies.com/mentors
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
}
<./style>
Q. I am trying to figure out how to make a check box on an HTML form checked by
default.
A. 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">
document.form_name.check_box_name.checked=true
<./script>
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">
document.form_name.check_box_name[0].checked=true
<./script>
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
month:
<.select name="beg_req_month">
<.?php
for($i=1;$i<.=12;$i++)
{
if($i==$prob_month)
{print "<.option value=’" . $i . "’ selected>" . $i .
"<./option>n";}
else
{print "<.option value=’" . $i . "’>" . $i . "<./option>n";}
}
?>
<./select>
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):
document.form_name.select_name.options[0].selected=true
[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:
<.html>
<.head>
<.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+ */
A.normal{color:blue}
A.over{color:red}
A.overb{color:lightgreen}
/* No underline on link for all browsers */
A{text-decoration:none}
<./style>
<.SCRIPT LANGUAGE="JavaScript">
/* 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
linkpage=linkval[0]
linkname=linkval[1]
linkdiv=linkval[2]
linkclass=linkval[3]
var linkd="<.A HREF="+linkpage+" CLASS="+linkclass+" onMouseOut=changeb(""+linknum+"")>"+linkname+"<./A>"
var docwrta="document."+linkdiv+".document.write(‘"+linkd+"’)"
eval(docwrta)
eval(‘document.’+linkdiv+’.document.close()’)
}
}
function changeb(linknum)
{
if(document.layers)
{
linkval=links[linknum].split(",")
linkpage=linkval[0]
linkname=linkval[1]
linkdiv=linkval[2]
linkclass=linkval[4]
var linkd="<.A HREF="+linkpage+" CLASS="+linkclass+"
onMouseOver=change(""+linknum+"") onMouseOut=changeb(""+linknum+"")
>"+linkname+"<./A>"
var docwrta="document."+linkdiv+".document.write(‘"+linkd+"’)"
eval(docwrta)
eval(‘document.’+linkdiv+’.document.close()’)
}
}
<./SCRIPT>
<./head>
<.body>
<.SCRIPT>
/* 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.
*/
<./SCRIPT>
<.CENTER>
<.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;
visibility:visible">
<.a href="http://www.requestcode.com" onMouseOver="change (‘1’);this.className=’textLgreen’"
class="normal" onMouseOut="changeb (‘1’);this.className=’textBlue’">Requestcode<./a>
<./div>
<./body>
<./html>
Q. How do you set up a forum?
A. Instead of creating one from scratch, you should look into the many free
forums available on the web. If your server supports Active Server Pages go to
http://www.aspin.com and do a search for "forums". If your server supports PHP,
go to http://www.code4u.com and choose a site to visit from there.
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
month:
<.select name="beg_req_month">
<.?php
for($i=1;$i<.=12;$i++)
{
if($i==$prob_month)
{print "<.option value=’" . $i . "’ selected>" . $i .
"<./option>n";}
else
{print "<.option value=’" . $i . "’>" . $i . "<./option>n";}
}
?>
<./select>
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):
document.form_name.select_name.options[0].selected=true
[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.]
News Goodies
***********************************
HP Moves NonStop to Itanium
[May 31, 2005] The systems vendor promises a server with ‘seven-nines’
availability.
Read the article:
http://www.internetnews.com/storage/article.php/3508701
Texas Slows Bells’ TV Plans
[May 31, 2005] A bill that would have allowed SBC and Verizon to offer TV
service statewide stalls.
Read the article:
http://www.internetnews.com/infra/article.php/3508781
AMD’s Dual-Core Athlon Hits
[May 31, 2005] Upstart chipmaker aims for select segments of computer users with
its next-generation, two-brain processors.
Read the article:
http://www.internetnews.com/ent-news/article.php/3508716
Novell Validates Mixed Stack
[May 31, 2005] The Linux vendor optimizes and validates Oracle, JBoss and HP
running on SUSE Enterprise Server 9 for enterprise customers.
Read the article:
http://www.internetnews.com/ent-news/article.php/3508771
Gateway Steps Up Low Cost Servers
[May 30, 2005] The systems vendor debuts new servers in its evolving line of
computing machines, looking to lure biz with low cost.
Read the article:
http://www.internetnews.com/storage/article.php/3508551
Yahoo Meets Searchers’ Mindsets
[May 31, 2005] New feature adjusts results for shopping or learning.
Read the article:
http://www.internetnews.com/xSP/article.php/3508581
Wi-Fi Still A Corporate Risk
[May 27, 2005] Business users on the fly could open the enterprise to attacks,
experts say.
Read the article:
http://www.internetnews.com/security/article.php/3508531
Google Print Goes Live
[May 27, 2005] Ambitious project is to digitize the world’s books opens — but
not without controversy.
Read the article:
http://www.internetnews.com/dev-news/article.php/3508536
IDC: HP Sneaks Up on IBM in Servers
[May 27, 2005] Sales grew 5.3 percent, as Windows and Unix tie in revenue.
Read the article:
http://www.internetnews.com/stats/article.php/3508346
CTIA: Ground Airline Cell Phone Use
[May 27, 2005] Wireless trade association says interference problems with
terrestrial services still exist.
Read the article:
http://www.internetnews.com/wireless/article.php/3508501
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:
mailto:nlfeedback@htmlgoodies.com
We already receive a lot of email every day. This address helps 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
https://www.htmlgoodies.com/mentors
Thanks for all your feedback!
Windows Tech Goodie of the Week
***********************************
Little Known, Invaluable Methods and Properties in the .NET Framework Base
Class Library
The .NET Framework Base Class Library (BCL) contains a slew of useful methods
that, I’ve found, are beneath the radar for most ASP.NET developers. This
article provides a listing of those .NET Framework BCL methods and properties
that are quite handy but not well-known.
http://aspnet.4guysfromrolla.com/articles/052505-1.aspx
*** AND ***
Array ASP.NET Sample Code
Most variables that you deal with contain one value. Sometimes however, it’s
useful to store more than one value at a time. Arrays are one easy way to do
this. This is an ASP.NET version of our classic ASP Array sample. It’s similar
to our classic ASP version with a few notable exceptions.
http://www.asp101.com/samples/array_aspx.asp
And Remember This …
***********************************
Since this newsletter is going out a day later than it is dated, and this
section is more fun if it is actually timely, it has been updated to reflect
events for May 31.
On this day in…
1078 Lady Godiva rode naked through the city of Coventry, England in
protest of taxes; 1837 the fanciest hotel in the US, the Astor, opened
for business (it later became the Waldorf-Astoria); 1879 Madison Square
Garden in New York City opened for business; 1884 Dr. John Harvey Kellog
received the patent for flaked cereal; 1889 2,209 died in the Johnstown
flood in Pennsylvania; 1891 work began on the Trans-Siberian Railway;
1907 Taxis began service in New York City; 1927 the last "Tin Lizzie"
rolled off the Ford Motor Company’s production line (was replaced by the Model
A); 1955 the US Supreme Court ordered school integration "with all
deliberate speed"; 1969 John & Yoko Lennon recorded "Give Peace a Chance"
and Stevie Wonder released "My Cherie Amour"; 1977 the Trans-Alaska oil
pipeline was completed; 1979 Zimbabwe proclaimed independence; 1991
the oldest bride on record, Minnie Munro, 102, married Dudley Reid, 83, in
Australia (cradle snatcher!);
Born today were: in 1819 poet Walt Whitman; 1872 English
illustrator/cartoonist William Heath Robinson; 1888 actor Jack Holt;
1908 actor Don Ameche; 1912 actress Barbara Pepper; 1916
actress Judy Campbell; 1922 English actor Denholm Elliot; 1923
Prince of Monaco Clint Rainier III; 1930 actor Clint Eastwood; 1934
actor Jim Hutton; 1938 musician Peter Yarrow (with Paul & Mary); 1948
musician John "Bonzo" Bonham (Led Zeppelin); 1948 actress Rhea Perlman;
1950 actor Gregory Harrison; 1950 actor Tom Berrenger; 1960
actor/comedian Chris Elliot; 1961 English comedian Harry Enfield; 1961
actress Lea Thompson; 1962 Canadian singer Cory Hart; 1965
model/actress Brooke Shields;