0

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:

  1. Microsoft JScript runtime error: Object doesn't support this property or method at document.addEventListener("mousemove", updateLastMouseMoveCoordinates, false);

  2. Microsoft JScript runtime error: Object expected at divSurveyInit();

  3. Microsoft JScript runtime error: Object doesn't support this property or method at document.addEventListener("mousemove", updateLastMouseMoveCoordinates, false);

1
  • 2
    Errors 1 and 3 are identical. Copy/paste error? Commented Mar 8, 2011 at 6:33

2 Answers 2

2

For IE versions < 9 you have to use the attachEvent method to add event listeners.

Sign up to request clarification or add additional context in comments.

Comments

1

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);
}

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.