Posted in Javascript onDecember 20, 2013
function getSelectedText() { //this function code is borrowed from: http://www.codetoad.com/javascript_get_selected_text.asp var txt = ""; if (window.getSelection) { txt = window.getSelection(); } else if (window.document.getSelection) { txt = window.document.getSelection(); } else if (window.document.selection) { txt = window.document.selection.createRange().text; } return txt; }
Javascript selection的兼容性写法介绍
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@