JAVASCRIPT 的传值问题

来源:百度知道 编辑:UC知道 时间:2024/05/30 18:12:14
==========代码=========
<script language="javascript">
function ToggleButton(document,checked,label,onclick)
{
if(!ToggleButton.prototype.over)
{
ToggleButton.prototype.over=_ToggleButton_over;
ToggleButton.prototype.out=_ToggleButton_out;
ToggleButton.prototype.click=_ToggleButton_click;
ToggleButton.images=new Array(4);
for(var i=0;i<4;i++)
{
ToggleButton.images[i]=new Image(ToggleButton.width,ToggleButton.height);
ToggleButton.images[i].src=ToggleButton.imagenames[i];
}
}

this.document=document;
this.checked=checked;
this.highlighted=false;
this.onclick=onclick;
if(typeof this.onclick=="String")
{
this.onclick=new Function("state",this.onclick);
}
var index=document.images.length;
document.write('<img src="'+ToggleButton.imagenames[this.checked+0]+'"border=0

此处的二句描述了文档运行对象和ToggleButton对象关系,第2句指示文档对象中image._tba即为该ToggleButton对象,从而文档运行便可以找到对象及其类型,否则文档运行将会找不着对象,不知道这样说你能否理解?