April 21, 2000

Use the SPAN Element to Define Styles Within a Block

While the DIV element can be used to designate block-level elements such as paragraphs and list items, SPAN is used within a block. And while most browsers will insert a line feed before and after the DIV tags, the text within the SPAN tags remains on the same line as

Dynamically Loading Different Files Into Frames

Using the frame’s location object, you can load a number of different files into a frame at runtime. As you do when building any project using frames, first build a file that defines your frame. For our example, we defined a frame called myframe. The code below would then go

Avoid Double Quotes Inside Quoted Strings

Avoid putting double quotes inside of double quotes in your HTML code. You may not get a compiler error, but your script just won’t work. Instead, substitute single quotes for any inner sets of double quotes, as in: Link.innerHTML = ” The Greatest Site on the Web “;

Pass Variables From Page to Page

We can pass variables from page to page with the following script: This snippet of ASP script will also automatically create hidden fields that will be dumped into all following form collection routines.

Nest Frames Within Frames

If you’re writing complex frame sets by hand, it’s easy to get lost in “spaghetti code.” To keep a handle on the situation, don’t build the entire frame set at once. Instead, build only two or three frames at a time. Once you get them to appear in the right

Use This Simple Function to Format Floating Point Expressions

JavaScript does not have a built-in function for formatting floating-point numbers. However, it’s easy to create one using JavaScript’s String methods. For example: function format(expr, decplaces) { // Convert the number to a string str = expr.toString() // Get the position of the decimal point point = str.indexOf(“.”) // Get

Determine Which Style Sheets to Use

There are some differences in Cascading Style Sheet implementation in Internet Explorer 3 and 4. So you may want to choose which set of style sheets to load for your web page depending on the user’s browser. This way, you can take advantage of some new attributes that are supported

Identifying Browsers Using ASP

Using the BrowserType object, your ASP pages can detect the type of browser being used to download the page. In addition, you can also test the browser for specific capabilities. The following code demonstrates how you can use the BrowserType object: Browser = Version = Frames = Tables = Background

Mouseover Effects for Links

The following code can be used in the tag of an HTML document for automatic mouseover effects on all links on the page. The styles ‘a’ and ‘a:visited’ are used for compatibility with Internet Explorer 3.0. The comment tags allow browsers that don’t support the hover effect to ignore this