Thursday, March 28, 2024

Goodies To Go! Newsletter #326

************************************************************
Goodies to Go ™
February 28, 2005 — Newsletter # 326

This newsletter is part of the internet.com network.
http://www.internet.com

Please visit http://www.htmlgoodies.com
************************************************************

A Note about Email Filtering:
All Goodies To Go newsletters are sent from the domain "internet.com." Please
use this domain name (not the entire "from" address, which varies) when
configuring e-mail or spam filter rules, if you use them.

Featured this week:

* Goodies Thoughts – A Dealer Sticker
* Q & A Goodies
* News Goodies
* Feedback Goodies
* Windows Tech Goodie of the Week
* And Remember This…

A Dealer Sticker

Ahhh! That new car smell! It’s one of the great pleasures of picking up a new
car. Keeping that smell is difficult, though — apart from the "absolutely,
positively no smoking under any circumstances whatsoever" rule, there have to be
rules against burgers, coffee, aftershave (especially when it’s still on the
hands!), dirty wet shoes, etc., etc.. But I digress….. having just brought
that new car home, you park it on the driveway and begin the proud "home
inspection". You admire it’s sharp looking front end, its sleek lines as you
walk its length, and from the back — the view the guy behind you will be
enviously looking at — you see……. horror of horrors! There’s an emblem
glued fast to that beautiful fresh paint that reads "Hornswaggler’s Dealership –
the dealer that’s the Best in the West!" It’s heartbreaking; especially because
you know there’s no way to get it off there without damaging the paint
underneath.

"Why is Vince talking about cars instead of the Web?" you ask. "Because there’s
a similar horror on the Web!" he answers.

I see it all too often. A great looking website, sleek, informative, to the
point and easy to use. But, down there at the bottom of the page, is that
"dealer sticker", only this time it reads "Web design by Top-o-the-line Designs
Company" and is a hyperlink to their home page.

If I was the client, I wouldn’t pay for the site until that was removed. Maybe
it’s just me, but I think it’s in very poor taste to design and build something
for someone else, but then try to use it as an advertising mechanism for myself.
To me, it’s the mark of a less than fully professional design business. Why, I
ask myself, do they need to advertise themselves on their client’s sites? If
their work was truly noteworthy, potential clients will be asking their existing
clients where they got their design work done.

I have no problem with the reverse, of course. That is to say, placing screen
capture images of clients’ sites on the developer’s own site as a portfolio
example, and linking them to the clients’ sites (all with each client’s
permission, of course) is perfectly acceptable. In fact it’s a very useful way
of letting potential clients know of the quality and scope of possibilities the
developer can provide.

Larger corporations that have in-house web design teams don’t advertise the
designers’ names on the corporate web site (except perhaps by the occasional
Easter Egg!) Why should my client expect something less?

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. After reading the Javascript Primers by Dr. Joe Burns in the HTML Goodies
home page I started to create my first own Javascript homepage. Everything went
fine and I managed to make the page the way I wanted. However, I had only
checked the results in Microsoft Internet Explorer, and when I in the end
checked it with Netscape (6.2) the Javascript did not work. I think this is very
strange since in the beginning of Dr Burns Primers it’s written that Javascript
was created by Netscape people. So, have I somehow used a MIE version of
Javascript? Where is it possible to find information about Netscape compatible
Javascript?

As a Javascript-example that works in MIE but not in Netscape my page tries to
use SPAN to have another color on the links when the mouse goes over them. So in
the beginning of my code it looks like this:
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Map</title>
<STYLE>
SPAN{cursor:hand;}
.onme1{color:purple;}
.offme{color:blue;}
</STYLE>
</head>
<script language="JavaScript">
<!– Hide from browsers that do not understand Javascript
function getonme() {
el = event.srcElement;
if (el.getAttribute("litUp1")!=null) {
el.className="onme1";
}
}
function getoffme() {
el = event.srcElement;
if (el.getAttribute("litUp1")!=null) {
el.className="offme";
}
}
document.onmouseover = getonme;
document.onmouseout = getoffme;
.
.
.
and so on …
And then a link looks like this
<a href="argentina.htm"><SPAN litUp1>Argentina</SPAN></a>
So in MIE the link ‘Argentina’ goes purple when the mouse goes over it but not
in Netscape. There are many other functions in my page that works in MIE but not
in Netscape. I would be very grateful for both general information about where
to find information about Netscape vs. MIE Javascript and/or how to solve my
specific problems.

A. First a little history. When Joe wrote his books, Netscape was at version 4
and yes, they did do a lot of work to develope JavaScript. At about the same
time, Microsoft wanted Internet Explorer to dominate the web and implemented
JavaScript in different ways. The result was that web developers had to cobble
together JavaScript that would first detect which browser the visitor was using
and then follow a script designed for that particular browser. In other words,
developers had to write two scripts where one should have sufficed. At about
this time, the World Wide Web Consortium, referred to as the W3C, set a standard
for all browsers to follow. One of the casualties was Netscape’s support for
layers, among others. Mozilla, which was affiliated with Netscape, was
developing a W3C compliant browser. Netscape adopted Mozilla features into it’s
version 6 browsers (We’re not sure what happened to 5) and they were
significantly more compliant than the current Internet Explorer version 5 as
well as Netscape 4. Although cross browser scripting became a little simpler, it
was still often required. The latest versions of both browsers, Netscape 7 and
Internet Explorer 6 are imminently better at W3C compliance and it is now
possible to build a web site with very little cross browser scripting, if any.
This history is very simplistic and the order of events may not be accurate.
Current technology as set by the W3C ( http://www.w3.org/ ) uses a combination
of HTML, Javascript, and Cascading Style Sheets (CSS) all following a Document
Object Model. The standards as described by the W3C on their web site tend to be
very technical and rightfully so. You will find sites such as mozilla ( http://www.mozilla.org/
)describe these standards in a manner more easily understood as well as
providing examples.
I noticed from your meta tags that you are using FrontPage to build your page.
Keep in mind that this is a Microsoft product and it will build a page that
works in Internet Explorer, but the pages will often not conform to W3C
standards and they will sometimes break in other browsers as you have found out.
Now on to your question:
<a href="argentina.htm"><SPAN litUp1>Argentina</SPAN></a>
does not conform to W3C. Argentina is part of a link. To change its color,
change the attribute of the link. Try it this way:
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Map</title>
<style type="text/css">
a {color:blue;}
</style>
<script type="text/javascript">
<!– Hide from browsers that do not understand Javascript
function getonme() {
document.getElementById("litUp1").style.color="purple";
}
function getoffme() {
document.getElementById("litUp1").style.color="blue";
}
//–>
</script>
</head>
<body>
<div>
<a href="argentina.htm" id="litUp1" onmouseover="getonme()";
onmouseout="getoffme()";>Argentina</a>
</div>
</body>
</html>
I looked at the source code for your web page and noticed that the JavaScript is
not between the head tags. Try moving it to between the head tags as in my
example above. I also noticed that you are relying on tables to position your
content. Although it works, a search on the net will return some interesting
articles on the use of CSS and div tags for positioning of elements on a page.
Use the following key words for your search:
CSS div positioning elements tutorial
Google gave me 2030 results.
[see also http://www.htmlgoodies.com/beyond/css  for our Goodies tutorials on
the subject – Ed.]

Q. I’m trying to get some JavaScript running. I’m able to parse two vars to a
function, the third one will not work.
This is the function:
<SCRIPT LANGUAGE="javascript">
function nieuw(a,b) {window.open (a, b, config=’height=600,width=200,toolbar=no,
menubar=no, scrollbars=no, resizable=no,location=no, directories=no,
status=no’)}
</SCRIPT>
It’s called by:
<a href=# onclick="nieuw (‘bijeenkomsten.html’,
‘newwindow’)">Bijeenkomsten</a>
My goal is to have the screensize set by the calling function, so far i’m unable
to do that. I tried by replacing the height and width values by var’s, tried to
put the height and width into the caller, nothing works. Is it possible to do
that or not, if yes how?

A. Actually, you can do it without calling a function. Try this for your code:
<a href="javascript:location=’bijeenkomsten.html’;
window.open(‘bijeenkomsten.html’,’Bijeenkomsten’,
‘height=600,width=200,top=10,left=10,toolbar=no, menubar=no, scrollbars=no,
resizable=no,location=no, directories=no, status=no’)">Bijeenkomsten</a>
Notice that I added two more attributes, top and left. You can determine where
to position the window as well. If you need to use the function, your call is
good, except for one possible item. Is newwindow the title of the window? If
not, replace newwindow with the title (could it be Bijeenkomsten?)
As for the function itself, remove config=.
Here it is:
<SCRIPT LANGUAGE="javascript">
function nieuw(a,b) {window.open (a, b, ‘height=600,width=200,toolbar=no,
menubar=no, scrollbars=no, resizable=no,location=no, directories=no,
status=no’)}
</SCRIPT>

Q. Is there a way to use a background image without it repeating? I’d like the
bgimg to simply enlarge itself to encompass each visitor’s window, instead of
doing the tile effect.

A. You are not going to be able to get the image to enlarge itself for every
resolution. In fact the site you sent has the image repeating. I even looked at
it on various resolutions and it repeated in all of them. That being said, you
can use some CSS – Cascading Style Sheet – to get an image to only show once as
a background.
Here is the code you should use:
<style type="text/css">
<!– body {background-image: url(images/your_image_name.gif);
background-repeat: no-repeat;} –>
</style>
Make sure you change the path and image name to suit your situation.

Q. This question most specifically refers to Javascript primer #27 on
http://www.htmlgoodies.com. I was just wondering if there’s any way to make a
link out of each of the pictures of the slide show, or better yet, open a new
window from each with javascript? (by clicking on the picture of course.) I was
also wondering if there’s a way to make a back one picture button without losing
the forward one picture button. Here’s the code..
<HTML>
<HEAD>
<SCRIPT type="text/javascript">
var num=1
img1 = new Image ()
img1.src = "btent1.jpg"
img2 = new Image ()
img2.src = "btent2.jpg"
img3 = new Image ()
img3.src = "btent3.jpg"
img4 = new Image ()
img4.src = "btent4.jpg"
function slideshow()
{
num=num+1
if (num==5)
{num=1}
document.mypic.src=eval("img"+num+".src")
}
</SCRIPT>
</HEAD>
<BODY BGCOLOR="#120F56">
<CENTER>
<IMG SRC="btent1.jpg" NAME="mypic" BORDER=0 width="275" height="240"
alt=""> <A HREF="JavaScript:slideshow()"><IMG SRC="rightarrow.gif"
style="position:absolute; top:260px; left:300px" border="0"></A>
</CENTER>
</BODY>
</HTML>

A. Here is a script for a slide show that has a link associated with each image.
<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>

News Goodies
***********************************

Bank’s Tape Loss Puts Spotlight on Backup Practices
[February 28, 2005] Bank of America’s admission on Friday that the company lost
data tapes containing federal workers’ account information could bring renewed
attention to data security issues.
Read the article:
http://www.internetnews.com/storage/article.php/3486036

Qwest Won’t Quit
[February 28, 2005] The regional carrier is reportedly willing to revise its $8B
offer for MCI again.
Read the article:
http://www.internetnews.com/infra/article.php/3486176

AMD Claims Better Way For Server Upgrades
[February 28, 2005] The company claims its new Open Platform Management
Architecture trumps IPMI by targeting the interface between the server platform
and its management subsystem.
Read the article:
http://www.internetnews.com/ent-news/article.php/3486076

A Staples.com Even ‘Lisa Listmaker’ Could Love
[February 28, 2005] UPDATED: Intensive customer research results in a site Lisa
Listmaker should love.
Read the article:
http://www.internetnews.com/ec-news/article.php/3486026

‘Internet Concierge’ Plots Web Services Course
[February 28, 2005] Rearden Commerce launches its Employee Business Services
application to help employees use Web services.
Read the article:
http://www.internetnews.com/ent-news/article.php/3486156

Borland To Expand Eclipse Projects
[February 28, 2005] One of the original founders of the open source development
organization plans to take a larger stake and is spearheading a new core
technology project.
Read the article:
http://www.internetnews.com/dev-news/article.php/3486021

Speed the Wireless Payment
[February 25, 2005] RFID-enabled ‘proximity’ payments could go wide in 2005, but
it’s up to merchants to make the move.
Read the article:
http://www.internetnews.com/ec-news/article.php/3485976

ChoicePoint ID Theft Stirs Up Congress
[February 25, 2005] When lawmakers return to work next week, private data
protection legislation will be all the rage.
Read the article:
http://www.internetnews.com/security/article.php/3485881

Phishing Attacks Jump 42 Percent
[February 25, 2005] An anti-phishing group says scam e-mails that seek users’
personal information increased sharply last month.
Read the article:
http://www.internetnews.com/security/article.php/3485971

Microsoft Rivals Get Turn With EU
[February 25, 2005] The European Commission is consulting with Redmond’s
competition to see if the company is complying with sanctions.
Read the article:
http://www.internetnews.com/bus-news/article.php/3485831

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
http://www.htmlgoodies.com/mentors

Thanks to all of you who wrote in following last week’s piece about protecting
pictures on a website (see
http://www.htmlgoodies.com/introduction/newsletter_archive/goodiestogo/article.php/3485016) Many of you suggested watermarking you pictures. There are various programs
available that can watermark a picture or graphic, whereby words or a mark of
your choice are "embossed" on the image. For some of you, this may be a way to
help protect your work. I didn’t include this in the piece because, especially
in the case of graphics, the effect diminishes the benefit of the item on the
page.

It was also suggested that I was promoting drab and boring sites. Far from it! I
merely said that if the pilferage was a concern for you, you should consider
putting less effort into your graphics and more into your content. One way to
"put less effort" into it would be to use your own combination of existing
graphics (but not copyrighted ones, of course!)

Thanks for all your feedback!

Windows Tech Goodie of the Week
***********************************

An Introduction to the Microsoft Enterprise Library

http://aspnet.4guysfromrolla.com/articles/022305-1.aspx

The Enterprise Library is a more unified collection of application blocks from
Microsoft’s Patterns and Practices Group and provides an easy mechanism to
accomplish common code tasks using libraries designed to showcase best
practices. This article provides a high-level overview of the Enterprise Library
and a quick peek into using the Data Access Application Block.

*** AND ***

The My Feature in Visual Basic 2005

http://www.15seconds.com/issue/050223.htm

In this article, Thiru Thangarathinam demonstrates the different classes and
features available through the My namespace. By providing a speed-dial that
allows you to more quickly and effectively utilize .NET framework
functionalities in your application, the My feature provides huge productivity
improvements for .NET developers.

*** AND ***

Bar Chart ASP.NET Sample Code

http://www.asp101.com/samples/bar_chart_aspx.asp

This script is an ASP.NET version of our classic Bar Chart sample. It remains
faithful to the original sample, so you won’t see any fancy graphics or image
work, just a simple, easy to implement bar chart.

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

On this day in…

1066 Westminster Abbey was opened; 1692 the Salem witch hunt began; 1784 John
Wesley chartered the Methodist Church; 1827 the first commercial railroad in the
US, the Baltimore & Ohio, was chartered; 1954 the US performed an atmospheric
nuclear bomb test at Bikini atoll; 1956 Jay Forrester received a patent for core
computer memory (which he invented in 1949, and which was the primary form of
main memory until the mid-70s); 1961 JFK named Henry Kissinger as special
advisor; 1966 the Cavern Club in Liverpool, England (where the Beatles used to
play) closed; 1970 bicycles were permitted to cross the Golden Gate bridge in
San Francisco; 1975 40 people were killed in the London Underground railway
system as a train sped past its final stop; 1983 125 million watched the final
episode of the comedy TV series "MASH"; 1990 Dutch police seized 3,000 Kilos of
cocaine; 1993 a gun battle erupted between the FBI and Branch Davidians at Waco,
Texas; 1994 in the US, the Brady Law went into effect, imposing a wait period
for the purchase of a handgun;

Born today were: in 1820 Illustrator (Alice in Wonderland) John Tenniel; 1910
movie director Vincente Minelli (husband to Judy Garland, father to Liza); 1915
actor Zero (Samual Joel) Mastel; 1923 actor Charles Durning; 1925 English actor
(born in Rangoon, Burma) Harry H. Corbett; 1931 actor Gavin McCleod; 1940 race
car driver Mario Andretti; 1942 musician Brian Jones; 1942 actor Frank Bonner;
1944 actress Kelly Bishop; 1945 actress Mimsy Farmer; 1948 actress Bernardette
Peters (Lazarro); 1948 actress Mercedes Ruehl; 1950 actress Ilene Graff; 1955
actor/comedian Gilbert Gottfried; 1955 musician Randy Jackson; 1957 actor John
Torturro; 1969 actor Robert Sean Leonard; 1971 actor John Buchanan;

 

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Popular Articles

Featured