0
<script language=javascript>
function getSelText()
{
    var txt = '';
     if (window.getSelection)
    {
        txt = window.getSelection();
             }
    else if (document.getSelection) // FireFox
    {
        txt = document.getSelection();
            }
    else if (document.selection)  // IE 6/7
    {
        txt = document.selection.createRange().text;
            }
    else return;
document.aform.selectedtext.value =  txt;
}
</script>

how do i identify the frames?.. document.getSelection(); and window.getSelection() only work for the frame the code is on. how do i change these getSelection(); for specific frame? i tried copying code to top frame but doesn't work.


i tried changing to this but no success

parent.link_frame.getSelection

Edited by MDanz: n/a

1
Contributor
1
Reply
2
Views
8 Years
Discussion Span
Last Post by MDanz
0

i tried changing to this to so it get's selected text from the top frame but still doesn't work.

<script language=javascript>
function getSelText()
{
    var txt = '';
   
     if (parent.link_frame.location.getSelection)
    {
        txt = parent.link_frame.location.getSelection();
             }
    else if (parent.link_frame.location.getSelection) // FireFox
    {
        txt = parent.link_frame.location.getSelection();
            }
    else if (parent.link_frame.location.selection)  // IE 6/7
    {
        txt = parent.link_frame.location.selection.createRange().text;
            }
    else return;
document.aform.selectedtext.value =  txt;
}
</script>
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.