B
Brian Genisio
Treetop said:What do you recommend I use then to make this work? If you have an
example of code would be wonderful.
Your solution has already been provided in previous posts:
Instead of :
///////////////////////////////////////////////////////
if (navigator.appName.substring(0, 7) != "Microso")
window.frames['external'].setup(links[aNum]);
else
document.external.setup(links[aNum]);
////////////////////////////////////////////////////////
Do the following:
////////////////////////////////////////////////////////
if( window.frames && window.frames['iframeName'] &&
window.frames['iframeName'].setup)
window.frames['iframeName'].setup(links[aNum]);
else if(document.external && document.external.setup)
document.external.setup(links[aNum]);
/////////////////////////////////////////////////////////
You check for the existence of the feature. For instance, where you
check for the string "Microsoft", I check to see if
window.frames['name'].setup exists. If it exists, that means the
browser supports the feature you want to execute. If not, check the
other method.
By doing it this way, ALL browsers that work the way Microsoft does will
work properly, and ALL browsers that work the way Netscape does will
work properly.
This type of check is similar to other languages that use many
references. For instance, in a C++ function, you would _NEVER_ write
the following code by itself:
object->subObject->property = "test";
Instead, you would make sure everything exists in place for you to do so:
if(object && object->subObject)
object->subObject->property = "test";
I hope this helps,
Brian