获取网页中被选中的文本
function getSelectedText()
{
var selectedText = '';
if (document.selection)
{
var range = document.selection.createRange();
selectedText = range.text;
}
else if (window.getSelection)
{
selectedText = window.getSelection();
}
return selectedText;
}