高分请教容易问题 this.height=1; this.size=Compute_size(); this.height=3;因为是同一个对象,所以你在给他付值之后变量了3,因此alert()的值也就是3了 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 1.这里只是说b继承Component2.<script type="text/javascript">function Rectangle(){ this.height=1; this.width=4; this.size=this.Compute_size(); this.height=3;}Rectangle.prototype.Compute_size = function(){ alert(this.height); return this.height*this.width;}var a=new Rectangle();document.write(a.size,"<br>"); 1。但是调用函数Compute_size()的时候this.height的值是1呀,只是在调用函数后才被赋为3。为什么在调用函数的过程中显示3?2。如果只说b继承了Component,那么a是什么? this.height=1;//此时为1 this.width=4; this.size=this.Compute_size(); this.height=3;//此时为3,最终为3 b是个类型(类),a只不过是b的prototype的一个引用 有难度,高手进! 急求"用户登录后长时间无操作,自动注销"的实现方法和代码,最好是用JS脚本控制 改一下鼠标跟随文字的排列... 如何保留树的状态? 一个框架问题 急!!js文件打开后为什么是乱码?是经过加密还是其他的?有办法还原吗? 怎样判断文本框中输入的是123.45形式 求助slidesjs这个插件的问题 网页上要做一个功能,输入框打空格出提示 javascript中document对象疑惑 js的中英文字符串长度的处理 请问如何让alt弹出的注释框显示在框架之上,解答出来再送分
2.
<script type="text/javascript">function Rectangle()
{
this.height=1;
this.width=4;
this.size=this.Compute_size();
this.height=3;
}
Rectangle.prototype.Compute_size = function()
{
alert(this.height);
return this.height*this.width;
}
var a=new Rectangle();
document.write(a.size,"<br>");
2。如果只说b继承了Component,那么a是什么?
this.width=4;
this.size=this.Compute_size();
this.height=3;//此时为3,最终为3