Josh,
This should work cross-browser for you:
---------------------------------
<script type="text/javascript" >
function popSelected(){
if (document.getSelection) {
var str = document.getSelection();
} else if (document.selection && document.selection.createRange) {
var range = document.selection.createRange();
var str = range.text;
}
var the_text = str;
newWin=window.open('',
'popUp','width=575,height=400,left=100,top=100,dir ectories=no,location=no,menubar=no,scrollbars=yes, status=no,toolbar=no,resizable=yes');
newWin.focus();
newWin.document.write(the_text);
}
</script>
</head>
<body onClick="popSelected()">
Your text goes here
</body>
</html>
|