Certain methods of the code return the scripting error message “Object does not support the property of method”. This error only happens on Internet Explorer, and not in other browsers.
Analysing this customer code, I was able to determine that there were some variables implicitly declared as strings:
1: variable = ' '
This code creates a variable of implicit string type. In another part of the code we can find this other declaration.
1: <div id="variable"> </div>
In the rest of the code we could find different operations applied to this very name variable in their aspects as a div element and also as a string variable.
1: variable += 'Hola mundo';
1: document.getElementById('variable').innerHTML = variable;
In this second example, the programmer tries to assign to the <div> element called variable of the DOM (in other browsers it’s only possible to access this variable in this way, more below) the contents of the string variable called the same way. This forces to the most the separation between the two namespaces (DOM objects and managed code scope). In this line the error was produced.
2: variable = ' ';
3: document.getElementById('variable').innerHTML = variable;
This code raises the error mentioned in the line 2, when the programmer really wants to create a new string variable with the same name.
We can see that Internet Explorer has created a “shortcut” to this DOM object using the type DispHTMLDivElement, creating this name collision. This facility for the programmer has the requirement of a proper naming convention on the part of the programmer.
I hope this post helps,