Convert IE project to Mozilla / firefox, Upgrade project to cross browser compatibility
Javascript functions for IE and Firefox mozilla /
How to convert internet explore ie compatible javascript into Mozilla firefox
Javascript function to read inner text of an object suitable for IE / firefox
//IE / FF compatabile innertext function
function readobjText(obj)
{
var x=(document.all )? obj.innerText:obj.textContent;
return x;
}
//to get value of a control placed in a cell girdview/ table cell
//ie table.rows[1].cells[1].all[0].value
function readcellobjValue(ofcell,tagtypename,ctrlno)
{
if (tagtypename== null) tagtypename ='input';
if (ctrlno== null) ctrlno = 0;
var x = ofcell.getElementsByTagName(tagtypename)[ctrlno].value;
return x;
}
//to set value of a control placed in a cell girdview
function setcellobjValue(ofcell,tagtypename,ctrlno,ctrlval)
{
if (tagtypename== null) tagtypename ='input';
if (ctrlno== null) ctrlno = 0;
ofcell.getElementsByTagName(tagtypename)[ctrlno].value = ctrlval ;
}
// keypress charcode/keycode checking - crossbrowser
function checkkeypressChar(evt,s1)
{
if (window.event)
{
var s = String.fromCharCode(event.keyCode);
s = s.toUpperCase();
if (s1.indexOf(s) <0)
event.keyCode=0;
}
else
{
var s = String.fromCharCode(evt.charCode);
s = s.toUpperCase();
if (evt.keyCode==0)
{
if (s1.indexOf(s) < 0)
evt.preventDefault();
}
}
}
any doubts feel freel to ask here
Regards

