Philip TAYLOR wrote:
Although this is (as far as I can tell) not Seamonkey-specific,
it is certainly demonstrable in Seamonkey and I am at a complete
loss to understand what is happening.  Wishing to capture and
report which text is highlit, I capture it during an onmouseover
and then seek to report it during an onclick.  The data are
saved in a global object.  Onmouseover reports that it has
been successfully saved, there is no further report that it
has been destroyed, yet onclick finds nothing there.  Is
anyone able to explain what destroys the saved data, and (even
better) tell me how to avoid this catastrophic data loss ?

I'd guess that the return value of window.getSelection(), which is a Selection object, always refers to the current selection. Once you click anything on the page (actually once you press the mouse button, not when you release it), the current selection is set to nothing.

To fix the issue, store the selection string in the "global" variable instead of the Selection object.

HTH

Jens

--
Jens Hatlak <http://jens.hatlak.de/>
SeaMonkey Trunk Tracker <http://smtt.blogspot.com/>
_______________________________________________
support-seamonkey mailing list
[email protected]
https://lists.mozilla.org/listinfo/support-seamonkey

Reply via email to