MDanz Posted October 16, 2009 Share Posted October 16, 2009 this is a get selected text function. It pastes into a textarea. This function works with a normal page(no frames... but with 2 frames it doesn't. it only works with the bottom frame.. when i want it to get selected text from the top frame. <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. Quote Link to comment Share on other sites More sharing options...
MDanz Posted October 16, 2009 Author Share Posted October 16, 2009 i tried changing to this but no success parent.link_frame.getSelection Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.