var selText = function(callback){
  document.body.addEventListener('mouseup', function(e){
    var selection;

    if (window.getSelection) {
      selection = window.getSelection();
    } else if (document.selection) {
      selection = document.selection.createRange();
    }

    if(selection.toString() !== '') {
      callback(selection.toString(),e.pageX, e.pageY);
    }
  });
};