﻿// JScript 文件
// String 构造函数的原型对象的一个方法。
String.prototype.trim = function()
{
    // 用正则表达式将前后空格
    // 用空字符串替代。
    return this.replace(/(^\s*)|(\s*$)/g, "");
}

try{
    HTMLElement.prototype.__defineGetter__
    (
    "innerText",
    function ()
    {
        var anyString = "";
        var childS = this.childNodes;
        for(var i=0; i<childS.length; i++)
        {
            if(childS[i].nodeType==1)
                anyString += childS[i].tagName=="BR" ? '"n' : childS[i].innerText;
            else if(childS[i].nodeType==3)
                anyString += childS[i].nodeValue;
        }
        return anyString;
    }
    ); 
}
catch(e){}
