首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > JavaScript >

object doesn't support this method or property,该如何解决

2012-02-08 
object doesnt support this method or propertyHTML的一个页面,在localhost环境下。SetMenu是在bodyonLoa

object doesn't support this method or property
HTML的一个页面,在localhost环境下。

SetMenu是在body   onLoad时触发。

function   SetMenu(){    
    var   wnt=new   ActiveXObject( "WScript.Network ");      
    //alert( "The   computer   name   is "+wnt.ComputerName+ ",User   name   is "+wnt.UserName+ ",DOMAIN   is   "+wnt.UserDomain);  
    document.getElementByID( "username ").value=wnt.UserName
}

这个alert是可以出来的,但是下面这句document.getElementByID( "username ").value=wnt.UserName则不行,会提示:
object   doesn 't   support   this   method   or   property

请问这是什么问题,如何解决?


[解决办法]
document.getElementByID这个错了,应该是document.getElementById

热点排行