没有这么多运气.我正在尝试确定var是否不为空.
$('#content').mouseup(function() { var selection = getSelected(); if (typeof(selection) !=='undefined') { alert(selection); } });