Thursday, March 28, 2024

Goodies To Go! Newsletter #365


************************************************************
Goodies to Go ™
November 29, 2005 — Newsletter # 3
65
 
This newsletter is part of the internet.com
network.
http://www.internet.com
 

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


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

Free Time
 
A short while ago I heard one of my neighbors talking about their young
son.  "In his free time he’s learning to write webpages," they said,
"whatever that might mean!"  A very basic, simple statement really, but boy,
did it set my brain off!
 
First, there’s that last part: "webpages, whatever that may mean!"  Come on
now!  OK, I will accept that there are some of our senior citizens who are
not familiar with the world of modern computers and the Web, but the parents
of a school age child?  The notion of "webpages" should by now be about as
everyday as indoor plumbing, sliced bread and microwave ovens!  It may
perhaps be true that the parents don’t know how to go about creating
webpages, which is a shame, but that’s not reason enough to play dumb about
the entire subject.  Wouldn’t it be a better idea to encourage the child,
and maybe, while they’re at it, have the boy show them what he’s learning,
"just to keep him on the right track," as it were? <g>
 
Then there’s that other part — the part where they mentioned "free time". 
That’s quite a notion also!  If you lose money, or a job, or, and I’m so
sorry for the awful thought, you lose your computer, these all can be
replaced.  Even lost data can eventually be regenerated.  But time; if you
lose time it is gone forever and can never be replaced.
 
To be technically correct, you can’t really lose time either, but you can
certainly waste it.  If time can be wasted then it has value.  Our language
even recognizes the fact since we say that we "spend" time doing one thing
or another.  I would argue that its irreplaceability makes time the most
precious thing we have.  It is not free!  (Neither is it ever "spare"!)
 
When we spend time, we are making an investment.  In the future that
investment will either pay off or not — that will determine the wisdom of
our investment.  Education is one of the soundest investments we can make. 
What’s more, and in my humble opinion, time invested in learning the ways of
the web is never wasted time.  It is valuable time, well spent!
 
Of course, there is also the possibility that I misinterpreted my neighbor
in another way: it is possible that "whatever that may mean" was referring
to the word "learning"!
 
 
 
 
 
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. 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 global editing them, that
would be an easy one to miss! – Ed.]
 
 
 
 
Q. I want to make a list of links for navigation in the form of a JavaScript
file, so that I can use one file and call it up from multiple pages without
the use of frames.  I found a tutorial on making js files & calling them
from another page, but I haven’t found how to make a plain text link using
javascript.
 
A.
You could try using document.write() to create your text links.  For
example:
document.write("<a href=’somepage.html’>Click Me</a>")
Just make sure you use single quotes within double quotes or vice versa. 
Also you might want to place the script within a div to help position it.
[Also, take a look at the Goodies Thoughts sections in:

http://www.htmlgoodies.com/letters/230.html
and

http://www.htmlgoodies.com/letters/231.html
— Ed.]
 
 
 
 
 
    
Q. I am a beginner working in the Primers and I am having a problem with
images.  I work with Windows XP.  When I open a page in the browser, the
image appears as a little box with a red "x" in the middle. (code sample and
description provided)
 
A. Images not showing properly are almost always due to the path being
incorrect. This could include the image not being in the right folder, the
image not being on the server at all or the path in the code being
incorrect. You mention that you tried naming the file "cougar.jpeg".  That
could be wrong as it could be "cougar.jpg" even if the image is actually a
JPEG file. Another path problem I see quite a bit is that the page is
looking for the image on the user’s computer instead of the server it
resides on. You may see something like this:
"file=///C:/Folder_Name/Folder_Name/cougar.jpg"
[Where your HTML code doesn’t specify a pathname, the image must be in the
same folder as the HTML page file. – Ed.]
 
 
 
 
    
Q. How do I link parts of the same image to different urls?
 
A. You should use an image map to create links on one image to different
URLs. HTMLGoodies.com has a couple of tutorials on image mapping. One is
called a Client-Side Image Map and the other is called a Server-side Image
Map. The server side uses CGI scripts to make the map work. The client side
does not. I suggest using the client side image map as it will probably be
easier to do. Here is the link to the entire tutorial.
http://www.htmlgoodies.com/tutorials/image_maps/
 
 
 
 
 
Q. I have a small wesbite dedicated to pictures and jokes of my friends, I
wanted to add a slideshow to the page, but have found myself having
difficulties with the code. Could you please help me?
 
A. Here is a sample of one that I have put together that might help:
<html><head><title>Image and Link Slide Show</title>
<SCRIPT LANGUAGE="JavaScript">
var a=0
// Enter your images Here along with the directory if need be.
  var imgs=new Array()
        imgs[0]="owls3.jpg"
        imgs[1]="hawks2.jpg"
        imgs[2]="pic221.jpg"
        imgs[3]="eagle1.jpg"
// Array used for preloading
  var myimages=new Array()
// Do the preload
     for(i=0;i<imgs.length;i++)
       {
        myimages[i]=new Image()
        myimages[i].src=imgs[a]
       }
// Enter your URLS and what you want to go in the ALT property.
// This is so when they mouse over the image, there will be a small
description of the Image or URL.
// Make sure you separate them with an ampersand "&"
//  so that the script can separate them out before writing out the link.
  var urls=new Array()
        urls[0]="http://www.requestcode.com&Requestcode"
        urls[1]="http://www.javascriptkit.com&Javascriptkit"
        urls[2]="http://www.dynamicdrive.com&Dynamic
Drive"
        urls[3]="http://www.htmlgoodies.com&HTML
Goodies"
// This is the function that displays the images and links.
// You should not have to modify it.
  function Doimglink()
     {
      if(a>imgs.length-1)
        {a=0}
      if(a<0)
        {a=imgs.length-1}
      newurls=urls[a].split("&")
      if(document.layers)
        {
         document.mydiv.document.write("<A HREF=’"+newurls[0]+"’><IMG
SRC=’"+imgs[a]+"’ BORDER=’0′ ALT=’"+newurls[1]+"’></A>")
         document.mydiv.document.close()
        }
      if(document.getElementById)
        {
         elm=document.getElementById("mydiv")
         elm.innerHTML="<A HREF=’"+newurls[0]+"’><IMG SRC=’"+imgs[a]+"’
BORDER=’0′ TITLE=’"+newurls[1]+"’></A>"
        }
     } 
// function used to display random image
function rannum()
    {
     len=imgs.length  // how many entries in the array
     prev=a           // Save the previous image index
     a=Math.round(Math.random()*(len-1))
     // If the current image equals the previous image,
     //  add one to get a different image.
     if(a==prev)
       {a++}
    }
window.onload=Doimglink
// In the DIV below you may have to add the top and left properties
//  to the style tag to position it correctly in the window.
// You must keep it positions as absolute for it to work in NS4.0+ browsers.
 
</SCRIPT>
</head>
<body onLoad="Doimglink()">
    <CENTER><H1>Manual Slide Show With Links</H1>
       <DIV ID=’mydiv’ STYLE="position:absolute;top:120;left:200"></DIV>
       <DIV ID=’ctrldiv’ STYLE="position:absolute;top:120;left:100">
        <A HREF="javascript:a++;Doimglink()">Next Image</A>
<BR>
        <A HREF="javascript:a–;Doimglink()">Previous Image</A>
<BR>
        <A HREF="javascript:rannum();Doimglink()">Random Image</A>
       </DIV>     
</body>
</html>
 
 
 
 
 
 
 

Discussion Goodies
***********************************
 
Have you seen the discussion forums on the HTML Goodies website?  It’s a
great place to get help from others who, just like you, are developing web
pages.  Many different topics appear in the forum, and a new one will appear
if you create it!  Here’s a sample of recent topics:
 
Photo Security-no right click question NEWBIE:

http://www.webdeveloper.com/forum/showthread.php?threadid=86733
 
change stylesheet javascript – opera problem:

http://www.webdeveloper.com/forum/showthread.php?threadid=86693
 
 
problem when comparing strings containing &quot;&amp;&quot;:

http://www.webdeveloper.com/forum/showthread.php?threadid=86681
 
 
 
 
 
 
 
 
News Goodies
***********************************
 
Amazon Wish Lists Expose Kids
[November 29, 2005] Online gifting could provide all the info a predator
could wish for.
Read the article:

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

Firefox Upgrade Near
[November 29, 2005] UPDATED: The organization will launch the first major
update to its browser since the official release of version 1.0 little more
than a year ago. 
Read the article:

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

Real-Time Linux Inside Defense Industry
[November 29, 2005] A U.S. Army program will use real time Linux system for
simulation testing despite concerns about the GPL license.
Read the article:

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

Cingular, Orange Pact ‘Eases Pain’
[November 29, 2005] The U.S. and U.K. carriers partner to make it easier for
international companies to manage their services.   
Read the article:

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

U.K. Warms to Sun’s Grid Storage
[November 29, 2005] Sun creates two new grid storage utility services and
agrees to dole out 2 million computing CPUs.
Read the article:

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

Skype Takes Another EBay Exec
[November 29, 2005] Henry Gomez will spearhead the VoIP service’s North
American expansion.
Read the article:

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

Wi-Fi Still Booming
[November 29, 2005] Sales of chipsets that enable wireless connectivity
topped 100 million units this year.
Read the article:

http://www.internetnews.com/stats/article.php/3566911
 

NetGear to Settle Speed Suit
[November 28, 2005] The wireless equipment maker will give discounts on new
gear and pay up to $700,000 in legal bills. 
Read the article:

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

EBay in High Court Over Patent Dispute
[November 28, 2005] UPDATED: Justices agree to hear long patent battle
between the online auctioneer and MercExchange. 
Read the article:

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

Retailers Brace For ‘Cyber Monday’ Onslaught
[November 28, 2005] Consumers hit the online shopping trail.  
Read the article:

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

 
 
 
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:
 
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

http://www.htmlgoodies.com/mentors/
 
 
 
 
 
Thanks for all your feedback!
 
 
 
 
 
 
 

Windows Tech Goodie of the Week 
***********************************
 
Dissecting the Validation Controls in ASP.NET 2.0
 
ASP.NET 2.0 doesn’t add any new validation controls, but it does fix the
validation control shortcomings in version 1.x, along with adding additional
features. In this article we’ll dissect the validation controls in version
2.0. Read on to learn more!
 
 

*** AND ***
 

ElseIf ASP.NET Sample Code
 
No it’s not a typo… VB.NET’s "ElseIf" really is different from "Else If"

and this difference can be very useful. It starts out like any other "If
Then," but there’s no space between the "Else" and the next "If."
 
 

*** AND ***
 

Using Visual Studio .NET Wizards to Create an N-Tiered Application – Part 3
 
This article is the third part of David Catherman’s series on using Visual
Studio .NET Wizards to create N-tiered applications. Part three looks more
intently into what can be done in the DataSet Partial Class to build a
Business Logic layer and also covers using Macros to help generate some of
the Data Access code.
 
 
 
 
 
 

And Remember This …
***********************************

1948 Australia’s First Car Unveiled

With Australia’s Prime Minister Ben Chifley among the 1,200 or so in attendance,
the first car manufactured entirely in Australia was unveiled on this day in
1948. Although its official designation was the 48-215, it was known as the
Holden FX. General Motors – Holden Automotive had accepted the Australian
government’s 1945 challenge for Australian auto parts makers to produce an
all-Australian car. The FX was their response, and proved to be a great success,
selling over 100,000 cars in the first five years of production. General Motors
Holden Automotive produced several more very successful models, including the
Torana and Commodore, enabling their Lion and Stone emblem to be exported around
the world, as well as selling well at home. In 1994 the company officially
adopted "Holden" as its company name. Their success continues today.

Today was also the day that in: 1877 Thomas Edison demonstrated the
phonograph; 1916 the US declared marshal law in the Dominican Republic;
1944
John Hopkins hospital performed the first open heart surgery; 1945
the Yugoslavian monarchy was abolished as the country declared itself a
republic; 1947 the UN general assembly partitioned Palestine between
Arabs and Jews; 1951 First underground atomic explosion, at Frenchman
Flat, Nevada; 1961 Mercury-Atlas rocket carried a chimp ("Enos") into
orbit; 1963 The Beatles released "I Want to Hold Your Hand"; 1964
the Roman Catholic Church in the US replaced Latin with English; 1968
John & Yoko Lennon released their first album "Two Virgins" in the UK; 1971
the first pro golf championship at Walt Disney World in Orlando Florida; 1987
Korean Air Boeing 707 en route to Seoul disappeared off Burma, 115 on board were
all lost; 1994 Russia bombed Grozny, the capitol of Chechnya;

Born today were: in 1803 color shift discoverer Christian Doppler
(Doppler Effect); 1832 author Louisa May Alcott (Little Women); 1849
English diode inventor Sir Ambrose Flemming; 1932 actress Diane Ladd;
1933
author Dr. David Reuben; 1933 blues singer John Mayall; 1940
jazz musician Chuck Mangione; 1949 comedian Gary Chandling; 1955
Canadian comedian Howie Mandel; 1959 actor Charles Grant; 1960
actress Cathy Moriarty; 1961 actress Kim Delaney; 1963 actor
Andrew McCarthy; 1968 musician Jonathan Raleigh Knight;
 

Previous article
Next article

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Popular Articles

Featured