It is usually for me to register javascript functions for specific events, doing something like:
myBtn.Attributes.Add("onClick", "Validate(getElementById('"+txtFirstName.ClientID + "'));");
I always used getElementByIdby myself, or, in other words, a document was not attached to it. But lately, I have been having pages when I try to use getElementByIdinstead document.getElementById. Why is this? Oddly enough, I have a site on which one page allows me to use only getElementById, but the other other page causes a javascript error because it cannot find the element if I only do it getElementById, and it will work only if I do document.getElementById.
Does anyone know why this is? Should I use document.getElementByIdeverywhere, regardless of whether it works without a document prefix?
EDIT: Could this have anything to do with one page using AJAX and the other not?
Jagd source
share