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. Link to comment https://forums.phpfreaks.com/topic/177854-javascript-frames-help/ 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 Link to comment https://forums.phpfreaks.com/topic/177854-javascript-frames-help/#findComment-937793 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.