devxlogo

September 29, 1998

JavaScript On or Off?

When using JavaScript in your Web pages, you should keep in mind that a user’s browser might not support JavaScript. This could either be because the browser is old or

Cursors Ready

Using JavaScript, you can set up a form such that when the Web page is loaded the cursor is in the text box. This functionality avoids making the user click

Namespace std May Not Be Modified

Generally, namespaces are open so it is perfectly legal to expand existing namespaces with additional declarations and definitions in several files. The only exception to the rule is namespace std.

JavaScript Debugger or Development Environment

If you’re looking for a development environment for JavaScript, JavaScript debuggers are available as a free download from both Microsoft and Netscape. The feature set of the two products is

Include Guards

#including a file more than once during the same compilation session will most likely cause the compiler to issue error messages since definitions and declarations of the file are repeated.

Seed the Random Number Generator

You can use Rnd followed by Randomize to seed Visual Basic’s random number generator. Whenever you use the same seed, Rnd produces the same sequence of random numbers: Rnd -1Randomize

Better Auto-Propercase

The “Auto-Propercase Text Box at Entry” tip [VBPJ May 1997, page 63] has a simpler solution. The StrConv function can propercase any string. You can achieve the same effect with