[jawsscripts] Re: Finding DOM element at the virtual cursor
- From: jaws tech <jawsmaster@xxxxxxxxx>
- To: jawsscripts@xxxxxxxxxxxxx
- Date: Tue, 10 Aug 2010 23:48:03 -0400
I need a generic way to do this because the element that I am on may not
have unique id or name information. In fact the only thing that may come up
for the elements I'm after are colspan=1 and one other one that I don't
remember. But those are not unique values.
The GetTag functions only return an index not an object reference to an
element. I need to get an element as an object variable so I can then work
within DOM functions. Something like:
oElement=insert code that I'm looking for
saystring(oElement.innertext) (or some other DOM method/property)
Like I said I prefer working in the DOM. It is much more powerful/flexible
than working with the JAWS functions.
I was originally thinking of using the virtual cursor column position if
that were in fact the sourceindex and then use code
such as:
iCol=GetCursorcol()
oIE=IEGetCurrentDocument()
oElement=oIE.all(iCol)
But this wasn't working for some reason. In fact, I don't even think I was
succeeding in getting the "all" collection. And as
I alluded to in my original post, I don't know if the virtual cursor column
represents the sourceindex of the document or not.
Any other ideas??
On Tue, Aug 10, 2010 at 9:53 PM, Chad Foster <chad.foster@xxxxxxxxxx> wrote:
> Check out the GetTag functions. They can help you locate tags and
> corresponding indices.
>
> On 8/10/10, Travis Roth <travis@xxxxxxxxxxxxxx> wrote:
> > I've not tried it, but I'd suggest looking at the GetElementDescription()
> > function and seeing if you can parse out the ID or name attribute.
> > If an element doesn't have either of those its going to be difficult to
> find
> > in the DOM with JavaScript...
> >
> >
> > -----Original Message-----
> > From: jawsscripts-bounce@xxxxxxxxxxxxx
> > [mailto:jawsscripts-bounce@xxxxxxxxxxxxx] On Behalf Of jaws tech
> > Sent: Tuesday, August 10, 2010 5:45 PM
> > To: jawsscripts@xxxxxxxxxxxxx
> > Subject: [jawsscripts] Finding DOM element at the virtual cursor
> >
> > Hi All.
> > I would like to find a reliable way to find the DOM element corresponding
> to
> > the current virtual cursor position. I like to jump into the DOM when
> doing
> > IE scripting instead of the JAWS functions and I need a way to grab the
> > current element. As most of you already know the GetFocusedElement()
> > functions just grab wherever the PC cursor is and have nothing to do with
> > JAWS'
> > virtual buffer. Also, can someone explain the significance of the row
> and
> > column output of the Virtual cursor's position. The column position
> seems
> > to correspond to the source index but I'm not sure what the row might
> > represent?? Understanding this might shed some light on getting into the
> > DOM.
> >
> > Thanks
> >
> >
> > __________�
> >
> > View the list's information and change your settings at
> > http://www.freelists.org/list/jawsscripts
> >
> >
> > __________�
> >
> > View the list's information and change your settings at
> > http://www.freelists.org/list/jawsscripts
> >
> >
>
>
> --
> Chad Foster
> Access Technology Solutions
> Leveling The Playing Field Through Technology
> http://www.GO-ATS.net
> __________�
>
> View the list's information and change your settings at
> http://www.freelists.org/list/jawsscripts
>
>
__________�
View the list's information and change your settings at
http://www.freelists.org/list/jawsscripts
Other related posts: