Javascript selection的兼容性写法介绍

时间:2013-12-20    点击:95   
复制代码 代码如下:

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;
}
JS delegate与live浅析
jQuery中delegate与on的用法与区别示例介绍
jquery数组之存放checkbox全选值示例代码
jquery如何通过name名称获取当前name的value值
前台js对象在后台转化java对象的问题探讨
> 返回     
地址:上海市普陀区胶州路941号长久商务中心 电话: QQ:
© Copyright 2012 上海网络 Product All Rights Reserved