|
December 5, 2000 Browser-Independent Scripting Tips: December 2000
Yehuda Shiran, Ph.D.
|
|
The introduction of Netscape 6 has worsen the browser-independent scripting situation, at least for the short time. No longer you have to deal with only two browsers - there are three major browsers to support. One good old way is to use if statements. You want to make your script as generic as possible, and use if clauses as late as possible. The following script uses this technique. The switchEntries() function is a common event handler for all browsers. The content of switchEntries() is an if statement that executes a different statement for every browser:
Click the button below and see how the first option is changing on the fly:
People who read this tip also read these tips: Look for similar tips by subject: |