I am using Firefox 2.0 on Windows and IE 7.0 on windows.
I cannot use a builtin button as the code is part of a complex web
application and it does not use built in buttons as they cannot be
styled in the way I require.
An example bit of script from some test code is on <img> on click
handler.
<img onClick="f=top.frames['test']; if (f)
{ alert(f.document.selection.createRange().text); }" blah blah>
I have partially solved it by using an onselect handler within the
document and simply remembering the result. Works OK but double click
select does not work.
Simon
On Oct 9, 4:50 pm, Thomas 'PointedEars' Lahn <PointedE...@web.de>
wrote:
> tylersi...@gmail.com wrote:
> > I am trying to get the current selected text from a document within a
> > frameset.
>
> > In Firefox all works well using getSelection.
>
> Which version?
>
> > In IE createRange is returning me a type of "None".
>
> Which OS, which version? How is createRange() called?
>
> > After some investigation it appears that the fact that this is in another
> > frame is critical.
>
> If the domains differ, that could be the case.
>
> > I am clicking on a custom button (it's a <div> with an <img> in it) in
>
> Eeek.
>
> > another frame - just as I do this the selection is lost. If I replace the
> > custom button with an <input> button then the selection is not lost.
>
> What is your "custom button" exactly? Why do you consider an "<input>
> button" not to be custom(izable)?
>
> > Is there any way to trap the loss of the selection before it occurs? I
> > have tried onfocus and onblur in the frameset but these are too late.
>
> Before you attempt to cure the symptoms further, show some of your code or
> post a URL.
>
> http://jibbering.com/faq/
>
> PointedEars
> --
> "Use any version of Microsoft Frontpage to create your site. (This won't
> prevent people from viewing your source, but no one will want to steal it.)"
> -- from <http://www.vortex-webdesign.com/help/hidesource.htm>