Goodies to Go (tm)
September 22, 2003-- Newsletter #251

By Vince Barnes



Goodies to Go (tm)
September 22, 2003--Newsletter #251

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


Featured this week:

* Goodies Thoughts - The World Brought Down To Size
* Q & A Goodies
* News Goodies
* Goodies Peer Reviews
* Feedback 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.

 

http://books.internet.com/books/0789727803

 

 

Goodies Thoughts - The World Brought Down To Size


Universal truth, the Mr. Universe competition, a "Galaxy of Savings" (as a local car dealer here proclaims) and many other examples illustrate how we love to bandy around adjectives whose real meaning is so large and whose scope encompasses so much that we could not possibly support the claim in anything resembling reality. How then is the humble programmer to understand when, in a field where precision is paramount and everything is either just right or simply wrong, we take such an adjective and apply it to a simple programming task? How indeed?! The answer, as you are probably aware by now, is by reading Goodies To Go, where programming tasks, when simply explained, become simple!

Questions have come up a few time recently concerning the penchant we have in this field for using the word "global" for a wide variety of things of varying scope. Global, of course, is meant to refer to the globe we know as Earth, and means something whose scope affects the whole world. Euphemistically, that's just how we use it, but the question is, what do we mean by our "world" when we do?

One example is the term "Global Variable". A variable is a data element used to hold a value that changes, as opposed to a constant, which is a data element whose value does not change. Various program languages will refer to "global" and "local" variables. The difference between the two is whether they are confined to a specified scope or are available outside that scope. What the scope is depends on the language and sometimes even on the context.

For example, in JavaScript, a local variable is one defined within a function using the "var" keyword. The value of this variable will unavailable to any other function on the page, or to any JavaScript code outside the function. JavaScript variables defined without the "var" keyword, or defined outside a function, are global. A global variables value is available to any function or any JavaScript code on the page. Thus, the scope, or "world", referred to by "global" in reference to JavaScript variables is a particular JavaScript function. Any JavaScript code on a different page, even though it is part of the same website and held on the same server, might as well be on a different planet as far as that variable is concerned!

Another example is the expression "global edit". This is a common task that programmers face. For example, if you copy some HTML code from this newsletter into a page you are working on, we have advised you to perform a global edit on the opening tag markers to change "<." into "<" so that they will work on your page (see the note at the beginning of the Q & A Goodies section in any original Goodies To Go newsletter.)  In this case, "global" means "more than one at a time."

In my favorite text editor (UltraEdit -- see http://www.htmlgoodies.com/toolbox/texteditors.html) it is up to me to define the scope that I want "global" to mean. I can open a file and replace each instance f a string in that file; or I can open several files and replace every instance of a string in all of them. I can also instruct it to replace a string in every file having a name matching a pattern I specify and residing in a directory (a folder) I specify. I can also say whether or not to search within subdirectories. In this way I can define my "world" far a global edit and can save a lot of time by so doing.

When malformed variables are creating conflicts within a series of programs I have, a well thought out global edit can restore harmony to the system. If only it were that easy with that other kind of global peace.

Thanks for Reading!
 

- Vince Barnes

 

Top

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 trying to figure out the way to provide the option popup window that gives the user the option to save or open a file they get off of a website, whether it be a PDF file or an image.

A. That is not something that the website controls. It is done automatically by the operating system when the user clicks on the file. If the user clicks on a link that is a PDF file for instance they may get the pop up box that asks if they want to save or open the file. If the user has Adobe Acrobat Reader installed on their computer it may just open it up using the Acrobat Reader control embedded in IE.




Q. I am new to HTML and I though that I would try a css to make things a little easier for me. I have been able to get most of it but I can't get anything to work for the BODY tag. I have tried cutting from the tutorial for color. And have tried cutting background image from the tutorial and from someone else's page then change name for my image. I can get font to work but can't seem to get it to work on the body tag. The image name is right I have cut it and put onto a page to double check.
Here is the code for my CSS page.
<STYLE TYPE="text/css"><!--
BODY {background-image: url(bicyclechain.jpg);}
TH {font-size: 9pt; color: #FFFFFF}
TD {font-family: Verdana, sans-serif; font-size: 9pt; color: #FFFFFF}
A{text-decoration:none}--></STYLE>

A. It appears to be the right code, but are your images in the same folder/directory as the CSS files? I would try two things: first, use lowercase letters for your HTML code in the HTML file and in the CSS file; second, use the full URL for the image, like http://www.mysite.com/images/picture.gif. Some browsers have trouble showing images from different folders, but can show them if you're using the full path (Netscape Navigator 4 is like this).




Q. I am wondering if there is a way to resize div layers according to browser size inside of a CSS? My page is set for a 1024x700 but would like it to resixe according to the viewers browser size. I know about the JavaScript version but will that work with a position absolute attribute?

A. You could use relative sizes instead of absolute if you want the site to be flexible against the user's browser size. Relative sizes are usually defined in percentages and absolute sizes in pixels. Unless you are looking for a way to resize the user's browser itself? That can't be done with CSS, but you could use JavaScript or DHTML.


 


Q. I'm looking for a password entry script that returns an asterisk in a textarea as a user enters each letter of their password.

A. I have not seen one where you enter a password into a textarea, but you can use the input type of password for that effect. Like this:
<input type="password" size="10" name="passw">
Also here is a link to some javascript password scripts: http://www.javascriptkit.com/script/cutindex6.shtml
You should know that JavaScript is not very secure when it comes to password protecting documents.




Q. I would like to do is to have the main window either resize with no menus (Like a standard pop up window, but without the pop up) or to have my swish (it's a product like Flash) come up in the browser window but sized at the right size without the user being able to change it.

A. Here is an example of how you can keep the main window at a set size, but you can change the other properties such as location, status, directories, etc. <html> <head> <title>Resize test</title>
<script language="JavaScript">
function doresize()
{
window.resizeTo(600,400)
}
window.onload=doresize
</script>
</head>
<body onResize="doresize()">
<center>
<br><br><br><br>
<h2>Resize</h2>
</center>
</body>
</html>




Q.
Is there anyway that I can get a functioning login and password box so that I can have people become members of my website? If so, do you know where I could find a layout or a template for that code?

A. There are a couple of ways to do that. The easiest way with no scripting is to password protect an entire folder. Your host may offer this. They would have to set it up for you. They then give you access to a text file that you can edit with as many passwords as you need. The other way would require some kind of scripting and possibly a database to hold the usernames and passwords. The scripting involved would depend on what you server supports. If it is a Linux server then you would have to use PERL or PHP. If it is a Windows server then you can use Active Server Pages(ASP). Take a look here: www.code4u.com. You may find something to use.



 

 

 

 

Top

News Goodies


The Ramifications of VeriSign's Wildcard Gambit
[September 22, 2003] Experts question VeriSign's new policy that catches URL typos, notably because there's no one with authority to make the owners of the .com and .net registry back down.

Click here to read the article


 

InterActive's Last-Minute Travel Trophy: Hotwire
[September 22, 2003] Why bother with an IPO when Barry Diller's company is willing to fork over $665 million in cash for the online travel discounter.

Click here to read the article

 

 

Borland Extends C++ to Palm Devices
[September 22, 2003] Mixing PalmSource SDKs with Borland C++BuilderX, the two companies say they can help fight the rising tide of Microsoft PowerPC devices.

Click here to read the article

 


 

FTC Expands Case Against St. Louis Spammer
[September 22, 2003] Agency claims Dutch citizen participated in scam misdirecting consumers to explicit Web sites.

Click here to read the article

 

 

EMC Airs Management Software for SMBs
[September 22, 2003] The storage systems vendor ushers in mid-tier applications to give small- and medium-sized businesses the ability to manage their storage devices more efficiently.

Click here to read the article

 

 

Microsoft Unveils Office 'Fourth Pillar'
[September 22, 2003] The software titan steps into the solutions space with a series of packages that sit on top of Office and can jumpstart efforts like Sarbanes-Oxley compliance.

Click here to read the article

 

 

IBM Boosts Presence, Awareness with Lotus 6.5
[September 22, 2003] Big Blue gears up to launch Lotus Notes and Domino 6.5 and signals a new bid to compete with Microsoft on the productivity suite front.

Click here to read the article

 

 


Amazon.com Looks for a Hit With Sporting Sales
[September 22, 2003] The e-commerce superstore enters the lucrative sporting goods and equipment market in partnership with big-name brands.

Click here to read the article



 

DealTime Morphs Into Shopping.com
[September 22, 2003] The shopping search engine renames itself and girds for battle against bigger search and e-commerce companies.

Click here to read the article

 

 


Maven Debuts Video/Data Platform
[September 22, 2003] The startup signs Virgin Records and others for software that could shake up the online ad market.

Click here to read the article

 

 

 

 

 

 


Top

Goodies Peer Reviews


 

Every week a site selected each week 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
 

 

 


Top

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


Remember the calendar script a few newsletters ago? I told you I would publish the URLs of a couple of you efforts with the script if you submitted them. Many thanks to those of you who sent in addresses. There were quite a few implementations of the calendar more or less "as is", such as http://www.ajlb2.com/calendar.html  and http://www.jontreby.fsnet.co.uk/Javascripts/Misc/calendar.html and there were some interesting modifications such as http://www.access4cheap.com/~lariffel/YearCalendar.html
Many thanks to all who participated.

If any of you have any interesting scripts that you have written that you would like to share with our readership, please send them in to the feedback address with the words "Script Submission" in the subject line. Please do not send in something you got from somewhere else. If you do an we publish it as your work, there's a good chance the copyright holders will come after you and we don't want that!!

Thanks again for all your feedback!

 


Windows Tech Goodie of the Week:


The Basics of .NET Tracing

http://www.asp101.com/articles/robert/tracing/default.asp

A standard debugging tactic when developing in ASP is to
use Response.Write statements to display troubleshooting information to the screen. With ASP.NET this practice has (thankfully) become obsolete as the result of a feature called tracing.
 


 

 

Top
And Remember This . . .


On this day in...

1776 Nathan Hale Executed for Espionage

American patriot Nathan Hale was executed by the British on this day in 1776. The Connecticut schoolteacher, Yale graduate and captain in the Continental Army had joined a Connecticut regiment in 1775. He participated in the siege of Boston in 1775 through which George Washington succeeded in driving the British out of Boston. In 1776 Hale crossed British lines in civilian clothes in Long Island, New York, to spy on them. He was captured as he attempted to return on September 21st, and was hanged without trial the next day. According to unverifiable legend, Nathan's last words were "I only regret that I have but one life to lose for my country."



Today was also the day that: in 1692 the last time a person in the US was hanged for witchcraft (8 people in Salem Mass. bringing the total to 20 for the "Salem Witch Trials"); 1944 the allies retake Boulogns; 1949 the USSR detonates its first atomic bomb; 1955 first commercial TV transmission in England; 1964 The Man From U.N.C.L.E. premiers on NBC-TV; 1973 Henry Kissinger sworn in as firs Jewish US Secretary of State; 1980 John & Yoko Lennon sign a recording contract with Geffen Records; 1989 composer Irving Berlin dies at 101; 1991 Dead Sea Scrolls made public by Californian university;

Born today were: in 1694 Lord Chesterfield (introduced the Gregorian Calendar in 1752); 1791 physicist Michael Faraday; 1927 baseball manager Tom Lessorda; 1939 Japanese mountaineer Junko Tabei (1st woman to climb Everest); 1954 actress Shari Belafonte Harper; 1956 singer Debby Boone; 1960 singer Joan Jett; 1960 actor Scott Baio


Thanks for reading Goodies to Go!

 

Archive Home Page.



Make a Comment

Loading Comments...

  • 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