smerf wrote:
If I have an iFrame on a webpage, and a user selects text or objects in the
parent of my iFrame, how can I get the selected text or objects properties
from my iFrame child?
In general how the browser exposes a text selection to script is highly
browser dependent.
Mozilla and by now Opera 9 expose a selection object per window that you
can access as
if (typeof window.getSelection != 'undefined') {
var selection = window.getSelection();
}
respective for the iframe then
if (window != parent && typeof parent.getSelection != 'undefined') {
var selection = parent.getSelection();
}
One documentation for that selection object is here:
<http://www.xulplanet.com/references/objref/Selection.html>
--
Martin Honnen
http://JavaScript.FAQTs.com/