[心缘地方]同学录
首页 | 功能说明 | 站长通知 | 最近更新 | 编码查看转换 | 代码下载 | 常见问题及讨论 | 《深入解析ASP核心技术》 | 王小鸭自动发工资条VBA版
登录系统:用户名: 密码: 如果要讨论问题,请先注册。
发表人 主题:能解释下代码吗?
王新安
身份:user
发帖:60
登陆次数:23
1F 发表于 2006/7/30 20:10:12
function fontChuli()
    {
    if ((document.selection)&&(document.selection.type == "Text"))
        {
        var range = document.selection.createRange();
        var ch_text=range.text;
        range.text = fontBegin + ch_text + fontEnd;
        } 
    else
        {
        document.post.msgContent.value=fontBegin+document.post.msgContent.value+fontEnd;
        document.post.msgContent.focus();
        }
    }
上面的代码算了手册,算是看懂了。可是下面的代码看不懂。能解释下吗?
function AddText(text) {
    if (document.post.msgContent.createTextRange && document.post.msgContent.caretPos) {      
        var caretPos = document.post.msgContent.caretPos;      
        caretPos.text = caretPos.text.charAt(caretPos.text.length - 1) == '' '' ?    text + '' '' : text;
    }
    else document.post.msgContent.value += text;
    document.post.msgContent.focus(caretPos);
    }
其中caretpos我怎么在手册里没查到这个词。

嘎嘎,是我
身份:admin
发帖:1435
登陆次数:3222
2F 发表于 2006/7/31 9:52:32
我也不懂,ubb这块是找现成的。

 
标题:
消息图标:                                             
                                            
正文:



* UBB 代码开启

 
CopyRight © 心缘地方 2005-2999. All Rights Reserved