2006/04/20 | convertFromHTML 技巧,使用动态文本框
类别(网摘) | 评论(0) | 阅读(33) | 发表于 09:18

摘自:http://www.darronschall.com/weblog/archives/000140.cfm

function convertFromHTML(the_string) {
    createTextField("converter_txt", getNextHighestDepth(), 0, 0, 0, 0);
    converter_txt.html = true;
    converter_txt.htmlText = the_string;
 
    // store the text so it doesn't get lost when we remove the
    // text field
    var txt = converter_txt.text;
    converter_txt.removeTextField(); // clean up
    return txt;
}
// usage:
trace(convertFromHTML("This is some <html> escaped text & stuff"));

0

评论Comments

日志分类
首页[28]
flash[3]
javascript[3]
C#[1]
feeling[5]
网摘[16]