Skip to content

Instantly share code, notes, and snippets.

@phiggins42
Created November 5, 2009 01:56
Show Gist options
  • Save phiggins42/226632 to your computer and use it in GitHub Desktop.
Save phiggins42/226632 to your computer and use it in GitHub Desktop.
// d.global == window, d.doc == document
// dojo.selection function defition (one-time cost to determine):
var _selection = "getSelection",
selection = d.global[_selection] || d.doc[_selection] || function(){
return d.doc.selection.createRange().text || "";
}
;
// namespace-polluting functions:
d[_selection] = function(){ return selection() + ""; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment