Subj : Re: Mozilla issues To : netscape.public.mozilla.jseng,netscape.public.mozilla.dom From : Martin Honnen Date : Thu Sep 08 2005 10:11 pm Crosspost and followup-to netscape.public.mozilla.dom Masao Miura wrote: > function changeBgColor(element,new_color) { > if(document.layers) > element.bgColor = new_color; > else if(document.all) > element.style.backgroundColor = new_color; > } If you explictly check for objects which are part of the IE or Netscape 4 model then Mozilla will happily ignore that code. You might want to try function changeBgColor (element, new_color) { if (element && element.style) { element.style.backgroundColor = new_color; } else if (typeof element.bgColor != 'undefined') { element.bgColor = new_color; } } that way if you pass in an element object the CSS inline background color will be changed with IE4+, Netscape 6+, Mozilla 1.0 and later, Firefox, Opera 7 and later and others. > code2: it doesnīt work, the popup donīt open... [foto=file_path.jpg; cata=a > reference to the object that calls the function] > function pop_foto(foto,cata){ > var p=window.createPopup(); Only IE 5.5 and later on Windows support window.createPopup, other browsers do not implement that function. > Why does it work fine in IE, but so-so in mozilla? Because whoever wrote the code scripted for IE (and in the first function for Netscape 4). -- Martin Honnen http://JavaScript.FAQTs.com/ .