function fake()
{
var ffake;
}
fake.prototype.abc = function()
{
fake.ffake = 1;//not working in IE7 but seems to be working in all others
}
var myNewObject = new fake();
由于剧本在那一瞬间破裂,无法前进。
首先,我没有理由,然后我花了差不多2小时在谷歌上找出解决方案。
任何帮助将不胜感激
答案 0 :(得分:3)
尝试更改:
fake.ffake = 1;
要:
this.ffake = 1;
示例:强>
function fake()
{
var ffake;
}
fake.prototype.abc = function()
{
this.ffake = 1;
alert(this.ffake);
}
var myNewObject = new fake();
myNewObject.abc(); // alerts "1"