January 2001
Beginner
312 pages
6h 4m
English
Can it be done? Can these kinds of examples be made to work in two browsers? In fact, the answer is yes!
The key to this is realizing that you can use the differences. The difference you are going to use is the fact that in Internet Explorer an object known as document.all exists. So, if you use an if statement to test for this, you can find out whether you're dealing with Internet Explorer 5 or Netscape Navigator 4:
<script language="JavaScript">
<!-- Cloaking device on!
function someFunction()
{
if (document.all)
{
//Expression is true, so put IE5 statements here
}
else
//Expression is false, so put NN4 statements here
}
// Cloaking device off -->
</script>
Following this method, creating a super JavaScript ...
Read now
Unlock full access