Tuesday, August 21, 2007

Script functionalities in IE vs Firefox

Every web developers must face the problem like, "some script functionalities work on IE, but not work on Firefox browser". Today I have faced one of the problem.

To display the Modal based (i hope everybody know about the term) popup window, one javascript function is available.. that function name is window.showModalDialog. This function works on Internet Explorer but not works on Firefox. So What i did was, i have written the code like,
 
if (window.showModalDialog) {
window.showModalDialog('mypage.htm', 'mypage', 'dialogWidth:255px;dialogHeight:250px');
} else {
window.open('mypage.htm', 'mypage', 'height=255,width=250,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,modal=yes');
}

 

0 comments: