类中有一个变量:
this.Grid; 这个变量用来指向该类的实例化后的对象。下面有个语句怎么老是过不去:var temp = "this.CheckBoxSelectAll.onclick = function(){SelectAllRow("+this.VV+")};"
eval(temp);
alert(this.CheckBoxSelectAll.onclick);不知道怎么回事,总是倒不了alert;
分不多,请高手指点一二
this.Grid; 这个变量用来指向该类的实例化后的对象。下面有个语句怎么老是过不去:var temp = "this.CheckBoxSelectAll.onclick = function(){SelectAllRow("+this.VV+")};"
eval(temp);
alert(this.CheckBoxSelectAll.onclick);不知道怎么回事,总是倒不了alert;
分不多,请高手指点一二
var temp = "this.CheckBoxSelectAll.onclick = function(){SelectAllRow("+this.Grid+")};"
window.xxx = this.Grid;
var temp = "this.CheckBoxSelectAll.onclick = function(){SelectAllRow(window.xxx)};"
所以搞了个eval(temp); 这句执行有问题
his.CheckBoxSelectAll.onclick = function() {SelectAllRow(this.Grid);};
这样应该是可以的。不知道你说的什么变量取不到值?
alert(eval(this.CheckBoxSelectAll.click));
eval('alert([this,this.CheckBoxSelectAll])')替换原来的语句执行下看看