June 1, 1998
DR. WEBSITE:
Closing Pop-Ups Automatically; Redirecting Rollover Text
By David Fiedler and Scott Clark
Dear Dr. Website: The pointer on how to deal with non-Java browsers when working with pop-up windows was helpful, but I've had a hard time finding out how to close the windows. I'd like to have the window open by a click--or, preferably, automatically--then after a few seconds, automatically close.
You can use an onLoad event to open a pop-up window when the main page finishes loading, or open the window via hyperlink (see below).
The setTimeout() function closes the window, and the 6000 is actually six seconds--but you can adjust it as you wish.
<SCRIPT LANGUAGE="JavaScript">
<!--//
function openit(sURL){
newwindow=open(sURL,"newwin","scrollbars=yes,
toolbar=no,directories=no,menubar=no,
resizable=yes,status=yes,width=600,height=500");
setTimeout("newwindow.close()", 6000);
}
//-->
</SCRIPT>
Dear Dr. Website: How do we write a rollover that displays button info in another part of the page--for example, in another cell of a table? Do we have to resort to frames? We want the rollover information to appear in the bottom cell of a table, but not over the button itself.
Use the same code you would for any mouseover, only use the name of the image you wish to change instead of the name of the image the mouse is over. For example:
<A HREF="javascript:void(0)"
onMouseOver="ImageOnly.src='/old?u=http%3A%2F%2Fwebdeveloper.com%2Fdrweb%2Fbad.gif&y=1999'"
onMouseOut="Image-Only.src='/old?u=http%3A%2F%2Fwebdeveloper.com%2Fdrweb%2Fanibal.jpg&y=1999'">moveit</A>
<BR><BR><BR><BR>
<TABLE BORDER=1><TR><TD>
<IMG name="ImageOnly" src="/old?u=http%3A%2F%2Fwebdeveloper.com%2Fdrweb%2Fanibal.jpg&y=1999" width="80"
height="107" border=0>
</TD></TR></TABLE>
Dear Dr. Website: Your April 20, 1998, article on editing the "404 File Not Found" message was interesting, but I can't find the .htaccess file that I need to change. Is this because of the authoring tool I'm using (Microsoft FrontPage 98)?
Actually, editing the .htaccess file is how virtually all traditional Unix-based Web servers allow you to control access to your Web directories in various ways.
If you don't have an .htaccess file in your directory, it's just because you haven't created one yet. Create the file on your local Windows system--in what would be your main directory under FrontPage--and edit it as necessary. FrontPage should upload it automatically the next time you publish your site.
On the other hand, you may be using a Microsoft server, such as IIS, that doesn't use the .htaccess file at all. If so, you need to go into the server configuration program; there, you will be able to set the page to be returned for 404 errors. The administrator can do this individually for every "virtual directory." For more on .htaccess, go to www.webdeveloper .comservers/servers_htaccess_ magic.html, and www.webdeveloper.com/drweb/19971117-drweb.html.