I am writing a Web Application in ASP.NET using C#. Whenever I run it, I get three types of Runtime Javascript Errors.
My Problem is that even though I am running a new Web Application with out any modification, then I also get the same errors.
These are the errors:
Microsoft JScript runtime error: Object doesn't support this property or method at
document.addEventListener("mousemove", updateLastMouseMoveCoordinates, false);
Microsoft JScript runtime error: Object expected at
divSurveyInit();
Microsoft JScript runtime error: Object doesn't support this property or method at
document.addEventListener("mousemove", updateLastMouseMoveCoordinates, false);
I am writing a Web Application in ASP.NET using C#. Whenever I run it, I get three types of Runtime Javascript Errors.
My Problem is that even though I am running a new Web Application with out any modification, then I also get the same errors.
These are the errors:
Microsoft JScript runtime error: Object doesn't support this property or method at
document.addEventListener("mousemove", updateLastMouseMoveCoordinates, false);
Microsoft JScript runtime error: Object expected at
divSurveyInit();
Microsoft JScript runtime error: Object doesn't support this property or method at
document.addEventListener("mousemove", updateLastMouseMoveCoordinates, false);
- 2 Errors 1 and 3 are identical. Copy/paste error? – Mat Commented Mar 8, 2011 at 6:33
2 Answers
Reset to default 2For IE versions < 9 you have to use the attachEvent method to add event listeners.
You can use attachEvent or addEventListener in an if...else
for different versions of IE and/or cross browsers like this or similar:
if (document.addEventListener){
document.addEventListener('mousemove', changeState, true);
document.addEventListener('mouseout', stopScrollingIfOutsideWindow, true);
document.addEventListener('mousedown', markMouseDown, true);
document.addEventListener('mouseup', unmarkMouseDown, true);
} else if (document.attachEvent){
document.attachEvent('onmousemove', changeState);
document.attachEvent('onmouseout', stopScrollingIfOutsideWindow);
document.attachEvent('onmousedown', markMouseDown);
document.attachEvent('onmouseup', unmarkMouseDown);
}