Posted January 27, 201213 yr I am using visual studio 2008 with ie9 when i run may project i face this runtime error Microsoft JScript runtime error: Object doesn't support property or method 'addEventListener' but other browers running very well. compelete error of this code is below, var ver = getInternetExplorerVersion() if( ver == 8.0 || ver == 7.0){ if (!document.body.addEventListener) { window.attachEvent('onscroll', onscrollVideofunction) window.attachEvent('onresize', onresizeVideofunction) window.attachEvent('onbeforeunload', onbeforeunloadVideofunction) } } else if(ver == 9.0) { document.addEventListener('scroll', onscrollVideofunction, true) document.addEventListener('resize', onresizeVideofunction, true) document.addEventListener('beforeunload', onbeforeunloadVideofunction, true) } function getInternetExplorerVersion() { var rv = -1 if (navigator.appName == 'Microsoft Internet Explorer') { var ua = navigator.userAgent if(window.MyObj) var temp = window.MyObj.JavaScriptIEVersion(ua) var re = new RegExp('MSIE ([0-9]{1,}[\.0-9]{0,})') if (re.exec(ua) != null) rv = parseFloat( RegExp.$1 ) } return rv } function onbeforeunloadVideofunction() { var temp = window.MyObj.JavaScriptDisposeVideoPanel() } var KeepTimeout function onscrollVideofunction(event) { window.MyObj.JavaScriptHideVideoPanel() clearTimeout(KeepTimeout) KeepTimeout = setTimeout('UpdateVideoPanel()', 200) } function UpdateVideoPanel() { var temp = window.MyObj.JavaScriptUpdateVideoPanel() } function onresizeVideofunction(event) { window.MyObj.JavaScriptHideVideoPanel() clearTimeout(KeepTimeout) KeepTimeout = setTimeout('UpdateVideoPanel()', 200) } Continue reading...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.