TitleWikiWizard JavaScript Internet Expolrer addEventListener
Date30-Mar-2007 11:05:14 EEST
Version2.4.100
Submitter213.61.68.130
Bug criticalityLightBug
Browser versionInternet Exporer 6
Bug statusNewBug
PageProvider used
Servlet ContainerTomcat
Operating SystemWindows
URL
Java version1.5

IE5/6 (7 unknown) does not support dom-function: document.addEventListener(event, function, param); properply - which is used in wikiwizard-jspwiki.js at line 6.

try following instead:

if (document.addEventListener) {
  document.addEventListener('DOMContentLoaded', changeWidth, null);
} else if (document.attachEvent) {
  document.attachEvent('DOMContentLoaded', changeWidth);
} else {
  document.DOMContentLoaded = changeWidth;
}
  • last else-block of this example should be checked


here is a more flexible solution with IE-onload bugfix

if (document.addEventListener) {
	document.addEventListener('DOMContentLoaded', changeWidth, null);
} else if (document.attachEvent) {
	if (!ie) document.attachEvent('DOMContentLoaded', changeWidth);
	else {
		var orgonload = window.onload;
		if (typeof window.onload != 'function') window.onload = changeWidth;
		else window.onload = function() {
			orgonload();
			changeWidth();
		}
		alert("ie event");
	}
} 

.. and so you can add changeWidth-Functio for IE

...
	var myWidth = 0, myHeight = 0;
	if( typeof( window.innerWidth ) == 'number' ) {
	    //Non-IE
	    myWidth = window.innerWidth;
	    myHeight = window.innerHeight;
	} else if (typeof( document.body.clientWidth ) == 'number') {
	    myWidth = document.body.clientWidth;
	    myHeight = document.body.clientHeight;
	}
	
	if ( browser == "Netscape Navigator" || browser == "Opera")
	{
		document.getElementById("editarea").setAttribute("style","height:" + myHeight * .70 + "px");
		document.getElementById("WikiWizard").setAttribute("height","100%");
	} else if (browser == "Internet Explorer") {
		document.getElementById("editarea").style.height = (myHeight * .70) + "px"
		document.getElementById("WikiWizard").style.height = "100%";

	}

--MBB, 30-Mar-2007


sorry for "alert("ie event");" - forgot to remove

--MBB, 30-Mar-2007

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-4) was last changed on 30-Mar-2007 12:42 by MBB