Forum Moderators: open
this is the code:
function insertVal(id,el)
{opener.document.form1.getelementbyid(el).value = '1'
self.close()
}
this works fine in IE, but fails in Netscape 4, with the error 'Directory listing denied'. ???
how can i make this work in n4?
Anyway, we decided to demand that our customers at least upgrade to Netscape 6, which is slightly more compatible with web standards. This has made the job somewhat easier since N6 recognize the getelementbyid keyword.
Perhaps this Javascript function might help (the code at the start detects the kind of major browser being used). [Sorry for the lack of indentation; Webmasterworld seems to remove it. If anyone knows how to include it, I'm interested.]
// Determine type of browser (OP (Opera), NS6, NN4, IE, or DOM)
// If multiple types, first one is it
var NN4=false; var IE=false; var DOM=false; var NS6=false; var OP=false;
if (navigator.userAgent.indexOf('Opera') >= 0) OP=true;
else if (navigator.userAgent.indexOf('Netscape6') >= 0) NS6=true;
else if (navigator.appName == 'Netscape' && navigator.appVersion.indexOf('4.') == 0) NN4=true;
else if (document.all) IE=true;
else
alert('Browser "' + navigator.userAgent + '" is not recognized.');
if (document.getElementById) DOM=true; //Unusedfunction GetElement(ArrName, Id)
{
if (ArrName == 'frames')
Where = 'window.' + ArrName;
else if (ArrName == 'forms')
Where = 'document';
else if (IE)
Where = 'document.all';
else if (OP)
return eval('document.getElementById("' + Id + '")');
else
Where = 'document.' + ArrName;//alert('Where: ' + Where + ', Id: ' + Id);
if (eval(Where) == undefined)
alert(Where+' is undefined (std.js/GetElement)');
else
return eval(Where + '.' + Id);
//return eval(Where + "['" + Id + "']");
}