Goodies to Go (tm)
April 5, 2004-- Newsletter #279

By Vince Barnes



Goodies to Go (tm)
April 5, 2004--Newsletter #279

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


Featured this week:

* Goodies Thoughts - Getting the Red Out
* Q & A Goodies
* News Goodies
* Goodies Peer Reviews
* Feedback Goodies  
* Windows Tech 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 - Getting the Red Out


I know this is a very basic thing, but you'd be surprised how often it becomes a stumbling block for newer web designers. I'm talking about the little red "X" that shows up when your web server can't find something. For those of you who are completely familiar with the perils of the red "X", there may be some useful tips on organization in here too!

This situation, which comes up in questions several times a week, is where you have built some pages on your PC and they look great. You upload them to the server and when you look at them there, you get boxes with little red "X"s in them everywhere your pictures should be.

The cause is that the web server can't find your pictures where you said they should be. "But," you protest, "they're in the same folder as the pages, just like they were in on my computer. So what gives?" "It's your relatives," I say, helpfully, "or at least, the lack of them."

Now that I've got you completely confused, let me explain. When the pages were on you computer they were in a folder (aka a directory) called (for the sake of this example) "C:\sites\thissite". When you included them in your pages you may have coded something like:
<img border="0" src="C:\sites\thissite\picture.jpg">
Now that they're up on the server the actual folder pathname might be something like "F:\cutomers\us\isp1\johnny\home\website" or even "/var/http/custdata/sites/~johnny" depending on your service providers setup and operating system. In any case, it's highly unlikely to be "C:\sites\thissite"! Hence the path to the picture is invalid and the picture is not found.

What you should have done instead is to address all components of your website relative (there's that word!) to the root folder of the site; that is the folder at the top of your folder (directory) structure and which contains your site's home page. For example, if the picture is in the same folder as the page, it needs no pathname at all, giving a tag like this:
<img border="0" src="picture.jpg">
If the picture is in a folder below the one the page is in, add the folder name (here it's called "images" to the path in the tag like this:
<img border="0" src="images/picture.jpg">
If your page is in a folder at a lower level than the root, say one called "level2", and the image is in another folder below the root, as in the last example, then your pathname needs to point to its parent folder using "../" (dot, dot, slash) which indicates "my parent folder" (put another way, it means up one level). In this example the tag would look like this:
<img border="0" src="../images/picture.jpg">
which says up one level, down into images and the file name is picture.jpg.

To go up more than one level, you'd use more than one "../" like this:
<img border="0" src="../../images/picture.jpg">

Using relative addressing like this enables the site to be moved from computer to computer without breaking the integrity of addresses within the pages. The relationship between the address of the page and the address of the picture remains the same.
Organizing your pictures and pages into a sensible hierarchy of folders can bring lots of other benefits to you also. I have discussed this before in this newsletter, and you can find that discussion here:
http://www.htmlgoodies.com/letters/224.html

 

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. How do I attach the "onClick" event handler to plain text? What I am trying to do is load the Javascript function contained in the code in a new window using a text link to pop the referenced URL in a specifically-sized window with most of the bells and whistles disabled. While the code I have below works "okay", it doesn't work the way I want it to. I think I need to use the 'onClick' handler to accomplish this, but the only references to that handler I can seem to find on HTMLGoodies uses form buttons, or regular HTML links. I want to use plain text links. I tried this:
<a href="" onClick="javascript:popup("URL")">Text here</a>
..but all I got was my local desktop in the window when I tested it. Here is the code I am using to call my popup window on page load:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html>
<head>
<title>BridgeMon</title>
<!-- TWO STEPS TO INSTALL POPUP WINDOW:
1. Paste the first into the HEAD of your HTML document
2. Use the code to open the popup page on your site -->
<!-- STEP ONE: Copy this code into the HEAD of your HTML document -->
<SCRIPT LANGUAGE="JavaScript">
<!-- Idea by: Nic Wolfe (Nic@TimelapseProductions.com) -->
<!-- Web URL: http://fineline.xs.mw -->
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->
<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "',
'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=320,height=210');");
self.close();
}
// End -->
</script>
<!-- STEP TWO: Paste this onLoad event handler into the BODY tag -->
<BODY onLoad="javascript:popUp('URL')">
<!-- Script Size: 0.73 KB -->
</head>

A. Part of your problem is that you left the "href" blank. This causes problems with the link. There are some different ways that you can accomplish what you want. The first one is to use the "#" pound sign to void the link so that only the onClick event works. For example: <a href="#" onClick="popup('somepage.html')">Text here</a>
(You also do not need to specify "javascript" in the onClick event)
You can also call the function by placing the function call in the "href" like this.
<a href="javascript:popup('somepage.html')">Text here</a>
This does away with the onClick event. I also noticed that you surounded the URL with double quotes and at the same time surounded the function call with double quotes. When you are doing a function call like your example it should be single quotes within double quotes or double quotes within single quotes.





Q. I have developed a website for a consulting business. What steps do you need to take to make sure that copyrights are not infringed by using photos and graphics from other sites?

A. Website items are like any other property. If you use any images or any content for that matter from another website, you should get permission from the owner first, before you use them for your site.





Q. Could you please tell me how to link one page to a specific point on another page? Also, how do I link the top of one page to the bottom of the same page?

A. If you want to link to a spot on a particular page you can use the NAME ANCHOR. For instance if you had a long page and wanted to give the user an easy way to get back to the top after reading the article you would place this in the HTML near the top after the <BODY> tag:
<a name="top">
At the end of the article you would place this code:
<a href="#top">TOP</a>
That creates a link to the top of the page. If you want a link to a certain area on another page it is done in a similar way. On the page you want to link to you place the NAME ANCHOR in the spot on the page you want to jump to:
<a href="jump">Jump Here</a>
On the page you are coming from, the link would look like this:
<a href="#jump">Click here to Jump</a>
Here is the tutorial from the HTMLGoodies site:
http://www.htmlgoodies.com/tutors/pagejump.html





Q. How do you get your brower reset because I have no status bar and no scrollbar?

A. You could provide a link like this to reload the document:
<a href="javascript:window.location.reload()">Refresh</a>
When the link is clicked on it would refresh the page.
[If you wish to restore the browser status bar (in Internet Explorer) click "View/Status Bar"




Q. I have created two pages one for high res and other for low resolutions, and want to create a "splash" page that will show some content while redirect the user to the correct resolution main page. This is the code I4m using to redirects the user to the correct res page. I need to add a delay of X seconds so the user can see the content of "splash" page before being redirected. How can i do this?
<script>
<!--
if (screen.width<=640)
top.location.href="index640.html";
if (screen.width<=800)
top.location.href="index800.html";
if (screen.width<=1024)
top.location.href="index1024.html";
top.location.href="index1280.html";
//-->
</script>

A. You could use setTimeout() to perform a function to redirect after so many milliseconds. Here is an example that will redirect to the specified link after 2000 milliseconds (2 seconds):
<script>
<!--
function Redirect(linkid)
{
top.location.href=linkid
}
if (screen.width<=640)
setTimeout('Redirect("index640.html")',2000);
if (screen.width<=800)
setTimeout('Redirect("index800.html")',2000);
if (screen.width<=1024)
setTimeout('Redirect("index1024.html")',2000)
top.location.href="index1280.html";
//-->
</script>




Q. (Re. Search Engine Submissions) I typically submit my sites using the tool provided by my web host. That's not because I want to, but more because I'm confused by all the 'services' out there that offer site submission - from $24.95/month to $500 one time fee for software that promises to submit, analyze and everything else in between other than fixing my breakfast. Before spending money on anything that I'm solicited to via email and ads on sites that I visit, I wonder if anyone might have a suggestion on a site submission tool that is really worth the money spent.

A. I am not a search engine/marketing guru be any means. I tell my clients up front that I do not guarantee a good placement in any search engine. There are people that do just website marketing and get paid very well. I do, however use this site to submit the websites of my clients: http://selfpromotion.com  Another site I use for information is: http://www.sitepoint.com  It has a lot of information about web sites from coding to marketing. I don't know if you are interested in PPC (Pay Per Click) marketing, but I suggest you take a look at http://www.overture.com  It has a really nice tool for seeing the amount of times a certain keyword was searched for in the previous month. It may help your META tags.
[There is a lot of information about all aspects of Search Engines, including a submission service, at http://www.searchenginewatch.com  - Ed.]

 

 

 

 

 

Top

News Goodies


New Software Head in Sun Management Shift
[April 5, 2004] On the heels of announcing a major restructuring, Sun continues shifting senior management.

Click here to read the article

 


 

Sun's Financial Strategy -- Can It Work?
[April 5, 2004] Sun and Microsoft's deal may not help hide Sun's perilous position in the marketplace.

Click here to read the article

 

 

EMC Crafts 'True' Library For Data Recovery
[April 5, 2004] EMC is looking to offer a 30 to 60 percent back-up speed bump over tape systems with the new disk library.

Click here to read the article



 

Where You See a Gym, They See a Supercomputer
[April 5, 2004] USF's bid to build an ad hoc supercomputer in a single day hits major speeds, but falls short of benchmarking goals.

Click here to read the article

 

 

 

A New Approach to Fortify Your Software
[April 5, 2004] A startup has come up with a solution to security flaws -- make the app safe before you deploy it on the network.

Click here to read the article

 

 

 

Challenges Ahead for .NET, Java Union
[April 2, 2004] Customers and developers could be the deciding factors on whether this deal flies or crashes.

Click here to read the article
 

 

 

Apple Sees a Shift in Developer Profiles
[April 5, 2004] Ever since the Macintosh maker put its trust in UNIX, the company has seen an unanticipated change in the backgrounds of its application developers.

Click here to read the article

 

 


American Firms Pitch 'In-sourcing,' 'Onshoring'
[April 2, 2004] FEATURE As overseas options increase, U.S.-based contract software development firms are highlighting quality and security to potential enterprise customers.

Click here to read the article

 

 

Task Force: Patches Must be Small, Easy to Install
[April 2, 2004] A high-powered cybersecurity task force recommends patch management principles to ensure security patches are well-tested, small, localized, reversible and easy to install.

Click here to read the article


 

 

Study: Virus Attacks Up But Infections Hold Steady
[April 1, 2004] Last year more -- and more dangerous -- viruses raced across the Internet than ever, according to a new study. But there was a glimmer of good news.

Click here to read the article

 

 

 

 


Top

Goodies Peer Reviews


 

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


For those who are missing Peer reviews: we are once again revising the Peer review program in the hopes of creating a workable solution. The current plan is to move the new Peer Review pages into place in the new year. All those who have been selected for reviews in the past will be featured in the new pages. The new method will make it much easier for your peers to provide feedback and much easier for us to handle the publication side of things. "Watch this space!" It's coming soon!!

 


Thanks again for all your feedback!
 

Top


 


Windows Tech Goodie of the Week:

 

Exploiting .NET's Advanced Deployment Features

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

Tony Arslan shows how to use VS .NET's custom deployment feature to create
configuration files on the target machine during installation.


*** AND ***


Department of Homeland Security Threat Advisory Level Retriever

http://www.asp101.com/resources/visitors/index.asp#dhspull

This script pulls the current threat advisory level from the Department of
Homeland Security's website and displays a graphic corresponding to the
current threat level on your site.

 

Top
 
 
 
And Remember This . . .


On this day in...

1951 Rosenbergs Sentenced to Death for Spying

Julius and Ethel Rosenberg were sentenced to death on this day in 1951, convicted of passing secret data about the atomic bomb to the soviets. While they pled their innocence until the end, they were executed in the electric chair in June of 1953. In 1950 the British arrested nuclear physicist Klaus Fuchs in England. When questioned, Fuchs admitted stealing secrets while working on the Manhattan Project (the secret US project to build an atomic bomb). Fuchs implicated his courier, David Greenglass who in turn implicated his sister and brother-in-law, Ethel and Julius Rosenberg. Their attorney argued that they were the victims of the anti-red "political hysteria" of the times, but Federal Judge Irving R. Kaufman described their crime as "worse than murder" saying that, "By your betrayal you undoubtedly have altered the course of history to the disadvantage of our country." He sentenced them to death.



Today was also the day that in: 1614 Indian princess Pocahontas married English colonist John Rolfe; 1887 Anne Sullivan taught Helen Keller to say "water"; 1895 Oscar Wilde lost his libel case against the Marquess of Queensberry, who had accused him of homosexual practices; 1896 1st modern Olympic Games officially opened in Athens; 1923 the Firestone company started production of their new inflatable tire; 1954 Elvis Presley recorded his debut single, "That's All Right"; 1955 Winston Churchill resigned as British PM; 1963 The Beatles received their 1st silver disc (Please Please Me); 1964 US General Douglas MacArthur died at the age of 84; 1974 The 110 story World Trade Center opened in NYC; 1993 Construction began on Cleveland's Rock & Roll Hall of Fame


Born today were: in 1725 (attributed) Italian writer/philanderer/adventurer Giacomo Casanova; 1900 actor Spencer Tracy; 1908 actress Bette Davis; 1909 film producer Alberto Romero "Cubby" Broccoli (James Bond); 1912 English actor John Le Mesurier; 1916 actor Gregory Peck; 1920 English author Arthur Hailey (Airport); 1922 English actor Christopher Hewett; 1929 actor Nigel Hawthorne; 1937 General/advisor to President George Bush (Nat Security Affairs)/Chairman of the Joint Chiefs of Staff (1989-93)/Secretary of State (2001-present) Colin Powell; 1941 actor Michael Moriarty; 1941 musician David Swarbrick (Fairport Convention); 1941 musician Eric Burden; 1963 singer Jimmy Osmond;

 


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