January 13, 2000

Display Local Date and Time

Question: JavaScript’s date() function gives the user’s computer date and time. How do I display my local date and time on my Web page regardless of where the user surfs from? Answer: Unfortunately, there is no way to do this with client-side JavaScript. You’ll need to do server-side scripting to

IE and Netscape Cache Components

Question: Is there any way to cache a .js file at the client, just like an image file, to reduce the number of trips to the server? Answer: You don’t have to do anything special to take advantage of this caching. Both Internet Explorer and Netscape will cache the .js

Cannot Flash Window’s Title Bar Using JavaScript

Question: How can I make the title bar of a window flash? Answer: This can’t be done using JavaScript. Most browsers delegate the responsibility for how their windows are displayed to their underlying operating systems. This means that from JavaScript you really don’t have any control over the window’s title

Using More Than One OnLoad Command

Question: Is it possible to use more than one onLoad command in my tag? Answer: Sure. Like other event handlers, the onLoad event handler you’re including within the tag on your page can actually be any valid piece of JavaScript code. This means that you’re not limited to executing just

Redirect More Efficiently in IIS 5

If you are using Internet Information Server version 5, you can redirect browsers to a new page more efficiently. In IIS 4, you had to use Response.Redirect as in this snippet: However, IIS 5 offers the Server object’s new Transfer method. Server.Transfer is faster because it doesn’t have to send

Iterate Through Control Arrays

When you need to iterate through all the elements of a control array, use this code: Dim J As IntegerFor J = Text1.LBound to Text1.Ubound With Text1(J) ‘ Work here… End WithNext J This way, if you add or remove controls from the array, your code still works. This assumes

Insert Soft Breakpoints

If you want to step through the code behind a certainscreen element at run time, you might do something like this in break mode: Hit Ctrl-Break from run mode, use the Find dialog to find the specific piece of code?say, cmdSave_Click?put a breakpoint on a line inside that sub, then

No more posts to show