Friday, February 7, 2025

Goodies To Go! Newsletter #333


************************************************************
Goodies to Go ™
April 18, 2005 — Newsletter # 333
 
This newsletter is part of the internet.com
network.
 http://www.internet.com
 

************************************************************
 


Featured this week:
 
*   Goodies Thoughts – A Question of Protection
*   Q & A Goodies
*   News Goodies
*   Feedback Goodies
*   Windows Tech Goodie of the Week 
*   And Remember This…
 
************************************************************

A Question of Protection

 
I have spoken many times before about the need to protect your computer and
its programs and data from all the hazards that is has to deal with. It
never ceases to amaze me, however, how little protection some people feel is
adequate.  Last week I had two different incidents where computers were
damaged by environmental menaces that could easily have been avoided.
 
With that in mind, I have assembled some questions for you to consider as
you look at your (and your friends’} computers.
 
Is the computer located on the floor where a water spillage would leave is
sitting in a puddle, or where little Johnny would crash into it with his
little cart?  Would it be better off on a couple of bricks, back further
under the table?  Or, is it sitting on a table or desk with the wires
dangling behind it so that little Johnny (or big Johnny, come to that) can
snag them as they sail past on a mission, pulling the whole thing down onto
the floor?  Also, is any of the hardware getting old and tired and
increasing its risk of failure?  The cost of losing it unexpectedly can be a
lot higher than the cost of a planned replacement.
 
Do you have proper surge and lightning protection?  Remember that the
"25,000 insurance" offered by the manufacturer isn’t worth anything at all
when it comes to your programs and data.  Select surge equipment based of
quality and reputation, not gimmickry.  Remember also that a power surge, or
lightning surge, can come up ANY wire into the computer.  That would include
power, phone, cable and network wires.  Surge protection is available for
all of these.
 
Do you have an adequate anti-virus protection?  You need something like
McAfee, Norton, Trend or Panda with virus definition no more than a week old
(update it every week with its automatic update or manually.)  I don’t
recommend something like "Joe’s Neato Anti-Virus".
 
Lastly, do you have proper anti-intrusion (a.k.a. "firewall") software in
place?  While it may be arguable that it is impossible to completely block a
hacker, you can certainly make it difficult enough to keep out all but the
most skilled, and they may not feel like going to the effort needed just to
get into your stuff.  This category would include getting completely up to
date with your patches by using Windows Update (or your Linux vendor’s
update service.)  Windows users should visit
http://www.microsoft.com/security/protect/ for some very helpful advice
on the basic steps needed to help in this area.  Windows XP has a built-in
firewall which may be adequate for your needs if you turn it on and use it. 
Windows XP Service Pack 2 (SP2) provides considerable improvements in the
area of security.  Have you installed it yet?  If you choose not to use a
McAfee or Norton firewall (or another well-known vendor’s product) but
select one available on the net, make sure that you research the product
before you depend on it.  You certainly don’t want to use a "protection"
product that is actually some hacker’s back-door!
 
Did you read the considerations in Goodies To Go! #329?  If not, you can
find it in the archive here:
https://www.htmlgoodies.com/introduction/newsletter_archive/goodiestogo/article.php/3492016
 
 
 

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 am trying to set up a framed site, with a dropdown list on the left,
and the main page to the right. I currently have the frame with the dropdown
list setup so that when the selection is changed, it opens up the selection
in that same frame. Is there anyway to change the frame it opens in?  I need
the menu on the left to bring up the pictures in the main frame rather than
the left one.
 
A. You need to change this link in your linkup function:
location.href = document.DropDown.images.options[number].value;
To this:
parent.frame2.location.href =
document.DropDown.images.options[number].value;
I would also recommend that you change the name of your dropdown as "images"
might cause a problem with JavaScript.
 
 
 
 
 
 
 
Q. In JavaScript Primer 28, the script does not work with my browser,
Internet Explorer 6.0. I believe that it has to do with nesting loops within
loops, but I am not sure. There is a note that some Internet Explorer
browsers will not display the code. What part of the JavaScript code is not
working?
 
A. Not sure why it does not work in IE, but here is a modified version that
works using the setTimeout method to control the fliping of images.
<html><head>
<script type="text/javascript">
  var num=1  img1 = new Image (150,150)
  img1.src = "0.gif"  img2 = new Image (150,150)
  img2.src = "1.gif"  img3 = new Image (150,150)
  img3.src = "2.gif"
  function startshow()
  {
   num=num+1
   if(num<4)
     {
      document.mypic.src=eval(‘img’+num+’.src’)
      anim=setTimeout(‘startshow()’,3000)
     }
   else
     {
      num=0
      clearTimeout(anim)
      document.mypic.src=img1.src
     }
   }
</script>
</head>
<body>
<center>
<img src="0.gif" name="mypic" border=0 alt="My Image">
<br>
<a href="JavaScript:startshow()">Display animation</a> </center>
</body>
</html>
Also here is a brief explanation of setTimeout:
setTimeout, a method of the window object, basically delays the execution of
a function or statement until the specified time has passed. The basic
syntax of this function is:
setTimeout("expression", delaytime)
"expression" is the function/statement you want delayed, and delaytime is
the delay time, in milliseconds.
I also use clearTimeout to stop the animation once it reaches the end of the
images array.
 
[Watch out for that period in the "num less than 4" in that JavaScript – if
you’re manually removing the periods instead of globally editing them, that
would be an easy one to miss! – Ed.]
 
 
 

 
 
Q. I have what seems like a complicated Image Rollover html. Here’s an
example:
Image 1 –> rollover –> becomes Image 1a
but I want two other images on the same page to also change at the same time
Image 1 becomes Image 1a
 
A. Here is an example of rolling over one image and having another image
change.  Take a look at it and you should be able to determine how to have
two images change at the same time.
<html><head><title>Image Flip</title></head>
<body>
<A HREF="#"
onMouseOver="document.ani1.src=’imgflip/drum.gif’;document.ani2.src=’imgflip/cherry.gif’"
onMouseOut="document.ani1.src=’imgflip/cherry.gif’;document.ani2.src=’imgflip/drum.gif’";return
true>
<img src="imgflip/cherry.gif" name="ani1" width="100" height="100"
BORDER="0"></A>
<A HREF="#"><img src="imgflip/drum.gif" name="ani2" width="100"
height="100" BORDER="0"></A>
</body></html>
 
 
 
 
 

    
Q. Is there anyway that I can make multiple frames load at a time without
using a form, and using just a regular link?
 
A. There are a couple of different ways you can accomplish this.  The first
example uses "inline JavaScript" to load two frames:
<a href="#"
onClick="parent.frame_name1.location=’page1.html’;parent.frame_name2.location=’page2.html’">Click
Me</a>
The second example uses a function that is passed the documents to load when
you click on a link:
<script type="text/javascript">
  function Doframes(page1,page2)
    {
     parent.frame_name1.location=page1
     parent.frame_name2.location=page2
    }
</script>
<a href="#" onClick="Doframes(‘page1.html’,’page2.html’)">Click Me</a>
In both examples you need to specify the name of the frame that you want the
documents to load in.
 
 
 

 
 
Q. I have one more problem with JavaScript programs.  A lot of times I
create variables and then when I try to use them I get an error saying that
they are undefined.  Why is this?  Here is an example of when this happens:
<SCRIPT LANGUAGE="JavaScript">
function part1()
{
var a = 1;
}
function part2()
{
if (a == 1)
{
document.form.textbox.value = "The variable worked, finally!!!";
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="form">
<INPUT TYPE="RADIO" NAME="why_doesnt" VALUE="the_variable_work"
onClick="part1();">
<INPUT TYPE="BUTTON" VALUE="Variable work?" onClick="part2();">
<INPUT TYPE="TEXT" NAME="textbox" VALUE="If the variable worked, a message
would appear here.">
</FORM>
If I write this in a document and click the button, an error message comes
up saying that it is undefined.  I’ve tried creating the variable directly
from the event handler, renaming the variable, using checkboxes instead of
radio buttons, and nothing works.  I have tried putting an alert box in the
function and it comes up so I know the function is executing.  It just won’t
remember the variable.
 
A. You are declaring a as a variable from within a function. This makes it a
local variable that is only accessable by that function.  You can make it a
global variable that is accessable by any function by declaring it from
outside any functions, but still between the script tags. Usually global
variables are declared before the first function for the sake of clarity,
but they can be declared from anywhere between the script tags, just not
inside a function. Here’s your script with a as a global variable:
<SCRIPT LANGUAGE="JavaScript">
var a = 0; // declares a as a global variable and initializes it to 0
function part1()
{
a = 1; // the function sets the global variable a to equal 1
}
function part2()
{
if (a == 1)
{
document.form.textbox.value = "The variable worked, finally!!!";
}
}
</SCRIPT>
</HEAD>
<BODY>
<FORM NAME="form">
<INPUT TYPE="RADIO" NAME="why_doesnt" VALUE="the_variable_work"
onClick="part1();">
<INPUT TYPE="BUTTON" VALUE="Variable work?" onClick="part2();">
<INPUT TYPE="TEXT" NAME="textbox" VALUE="If the variable worked, a message
would appear here.">
</FORM>
 
 
 
 
 

News Goodies
***********************************
 
Adobe to Buy Macromedia for $3.4B
[April 18, 2005] UPDATED: Adobe will pay Macromedia in stock to become a
greater graphics software power; a battle with Microsoft looms.
Read the article:

http://www.internetnews.com/bus-news/article.php/3498401
 

ISP Steaming Over Coffee Spam
[April 18, 2005] Activist hauls Gevalia Coffee into court over unsolicited
e-mail.
Read the article:

http://www.internetnews.com/xSP/article.php/3496551http://www.internetnews.com/xSP/article.php/3498586
 
Microsoft Bares Visual Studio 2005 Beta 2
[April 18, 2005] The company releases the second beta for its development
environment; also moves to CTP model for SQL Server 2005.
Read the article:

http://www.internetnews.com/dev-news/article.php/3498371
 

Sun RFID Goes 2.0
[April 18, 2005] New SOA version of middleware helps push computing to edge
devices.
Read the article:

http://www.internetnews.com/wireless/article.php/3498431
 

Intel Debuts First WiMAX Chip
[April 18, 2005] The company’s ‘Rosedale’ processor is designed for wireless
modems and residential gateways.
Read the article:

http://www.internetnews.com/wireless/article.php/3498396
 

Borland Gets Together Again With .NET
[April 18, 2005] The company’s modeling platform for the first time breaks
.NET projects down into roles and also includes UML 2.0 support.
Read the article:

http://www.internetnews.com/dev-news/article.php/3498466
 

SeaChange Liberates Overseas Assets
[April 18, 2005] The VOD specialist pays $25.5M for interactive TV
applications from Liberate Technologies.
Read the article:

http://www.internetnews.com/infra/article.php/3498456
 

E-Filing Up, Fear Down

[April 15, 2005] The number of folks filing taxes online is growing despite
the security traps that can trip them up.
Read the article:

http://www.internetnews.com/ec-news/article.php/3498131
 

Microsoft in PR Push For Longhorn
[April 15, 2005] Redmond begins to hype the next version of Windows in
earnest.  
Read the article:

http://www.internetnews.com/ent-news/article.php/3498231
 

China Retains a Tight Grip on Access
[April 15, 2005] The country continues to limit information on the Web.
Read the article:

http://www.internetnews.com/xSP/article.php/3498246
 
 
 

 
 
 
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 
***********************************
 
Incorporating SQL Server Reporting Services into your Web Site
 
This article by Don Franke examines using a combination of C#, Javascript,
an IFRAME, and SQL Server Reporting Services to create a one-click web page
for viewing all the reports for your web application.
 
 

*** AND ***
 

Unit Testing the Data Access Layer
 
Unit testing is becoming very popular among .NET projects, but unit testing
the Data Access Layer (DAL) still remains a common obstacle. This article
will show how to resolve these problems so that you can reliably unit test
your Data Access Layer.
 
 

*** AND ***
 

Server.Execute ASP.NET Sample Code
 
This script is an ASP.NET version of our classic ASP Server.Execute sample.

While Response.Redirect gets the job done, you can often accomplish the same
tasks more efficiently using Server.Execute.
 
 
 
 
 
 
 
 
 
 
 
 

And Remember This …
***********************************
 
On this day in…
 
1775 Paul Revere & William Dawes warned "the British are coming!";
1868
The San Francisco Society for Prevention of Cruelty to Animals was
formed; 1902 Denmark became the first country to adopt fingerprinting
to identify criminals; 1906 San Francisco Earthquake killed over 700
people; 1909 Joan of Arc wasdeclared a saint; 1924 The first
crossword puzzle book was published (Simon & Schuster); 1945
Clandestine Radio 1212, after broadcasting pro-nazi propoganda for months
used their influence to trap 350,000 German army group B troops; 1948
The International Court of Justice opened at The Hague in the Netherlands;
1963 Dr James Campbell performed the first human nerve transplant;
1964
Geraldine Mock of the US became the first woman to fly solo round
the world; 1968 London Bridge was sold to a US oil company (to be
erected in Arizona); 1980 Zimbabwe (formerly Southern Rhodesia)
declared independence from the UK; 1990 The US Supreme Court ruled
that states could make it a crime to possess or look at child pornography,
even in one’s home;
 
 
 

Born today were: in 1480 infamous murderess Lucretia Borgia; 1921
actress Barbara Hale;  1922 actress Avril Angers; 1925
actor Bob Hastings; 1926 German actor Gunter Meisner; 1929
actor Peter Jeffrey; 1934 actor James Drury; 1940 Princess of
Monaco Ira van Furstenburg (Virginia Caroline); 1946 English actress
Hayley Mills; 1946 musician Lenny Baker (Sha Na Na); 1947
actor James Woods; 1953 actor Rick Moranis; 1961 English
actress Jane Leeves; 1963 Talk show host Conan (Christopher) O’Brien;
1976 actress Melissa Joan Hart;
 

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Popular Articles

Featured