function() {
if (document.selection && document.selection.createRange) return document.selection.createRange().text ? document.selection.createRange().htmlText.replace(/[\r|\n]/g, ""): "";
else if (window.getSelection) {
var a = window.getSelection();
if (a.rangeCount > 0) {
var b = document.createElement("div");
b.appendChild(a.getRangeAt(0).cloneContents());
return b.innerHTML.replace(/[\r|\n]/g, "");
}
}
return "";
}
posted on 2009-06-24 15:05
汪杰 阅读(230)
评论(0) 编辑 收藏 引用 所属分类:
javascript