解决方案 »
- 当按下回车时给 textarea 插入一个值
- JS 动态添加Table 列样式没有效果 在线等
- 100分,在线等,在线结贴,求一 js 方法 :去除字符串中所有的 两个尖括号之间的内容,但保留<p>和</p>
- 求JS带时间选择的日历控件(ASP)
- 谁知道经常看到页面引入js的时候跟一个随机数是干嘛用的?
- FCKeditor编辑器中好预提示文字如何自动消失
- 如何控制一个输入域只能输入如下ascII码32、40-90、97-122的字符呢?
- 在javascript中如何获得checkbox 的ID号
- 找不到框架名了,无法刷新
- 有关JAVASCRIPT控制的问题(先给100,解决再加100)!!
- 如何获取页面的内容
- 监听 img 标签 属性变化的函数有木有?
stringBuffer.prototype.toString=function (){ return this._strings_.join(" ");};
function stringBuffer()
{
this._strings_=new Array();
}
stringBuffer.prototype.append=function (str){this._strings_.push(str);};
stringBuffer.prototype.toString=function (){ return this._strings_.join(" ");};
var string1=new stringBuffer();
string1.append("Hello");
string1.append("World");
document.write(string1.toString());//Hello World
{
this._strings_=new Array();
}
stringBuffer.prototype.append=function (str){this._strings_.push(str);};
stringBuffer.prototype.toString=function (){return this._strings_.join(" ");};
var string1=new stringBuffer();
string1.append("Hello");
string1.append("World");
//console.log(string1.toString());
string2 = string1.toString();
document.write(typeof(string1._strings_));
document.write(string2);
+1
toString 需要返回字符串