Home  >  Article  >  Web Front-end  >  JavaScript "Unexpected method or property access called" in IE_javascript tips

JavaScript "Unexpected method or property access called" in IE_javascript tips

WBOY
WBOYOriginal
2016-05-16 18:58:301302browse

The same piece of code, called twice, once passed and once exception:
function clearSelect(obj){
if(obj && obj.options)
obj.options.length=0;
}
The following are some previous experiences:
These are two classic anomalies, which are difficult to locate if you don’t know the principles. The conditions that occur can be seen from the code below