读书人

object doesn#039;t support this method

发布时间: 2012-02-08 19:52:21 作者: rapoo

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

读书人网 >JavaScript

热点推荐