[jawsscripts] Re: using GetElementsByClassName in a script

  • From: Bob <temp@xxxxxxxxxxxxxxx>
  • To: jawsscripts@xxxxxxxxxxxxx
  • Date: Mon, 9 May 2016 14:23:30 +0100

I have never had any success with getElementsByClassname using jaws. 

Some things to note though. 
These methods only work from IE so that may also be causing an issue. 
JavaScript is case sensitive and I have never tested if this translates through 
to the jaws scripts. Eg there is a difference between getElementById and 
GetElementByID. 

Some pointers:

Var Object Button
Var Object Buttons = IEGetCurrentDocument().getElementsByTagName("BUTTON")

ForEach Button In Buttons
 If Button.getAttribute("aria-hidden") == True Then
  Button.setAttribute("aria-hidden", False)
 EndIf
EndForEach

You may need more tests to ensure that you only make the required items visible 
and you may need to change the element to input from button but you will get 
the gist. 

Bob

On 9 May 2016, at 14:07, Jonathan Cohn <jon.c.cohn@xxxxxxxxx> wrote:

Offhand I don't remember. Perhaps its parent has a unique class or id  and 
then you could work down from there. Though I suppose at that point you would 
want to be using the JS methods available via GetDocument and not XML 
commands. I did once create a JAWS function that found every element that had 
an id starting with a specific string and add an ARIA tag to make it appear 
as a button to JAWS. Write me off list if you need me to find that code.

Best wishes,

Jonathan



On 9 May 2016, at 08:59, Jason Fayre <jfayre@xxxxxxxxx> wrote:

Ok, thanks! I'll take a look.
Can I use those functions to actually change an attribute in the DOM
though? I need to turn off the aria-hidden attribute so that JAWS can
see this particular button.



On 5/9/16, Jonathan Cohn <jon.c.cohn@xxxxxxxxx> wrote:
I believe you are stuck with the getXML and then using XML parsing commands
to get to the element in question. The Sharepoint scripts provided with the
JAWS use XML functions to grab the elements in the SharePoint toolbar and
present them in a dialog, this should give you a good starting point.


Best wishes,

Jonathan



On 9 May 2016, at 08:31, Jason Fayre <jfayre@xxxxxxxxx> wrote:

Hello everyone,
I'm still working on writing scripts for the internal credit card
application I mentioned a while ago.
I've run across a button that has aria-hidden=true set, so JAWS
doesn't see it. This site had another one just like this that I was
able to work around, but this one is giving me trouble. The button has
no ID set, but it does have a class. So, I should be able to use
GetElementsByClassName. The problem is that I'm not sure what type of
value this returns from a JAWS scripting standpoint. I thought it
returned an array, but that either isn't true, or I'm just not
accessing it correctly. Can anyone give me some pointers?
We are trying to reach out to the developers to get this stuff fixed,
but things are moving slower than we might like.
__________�

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
__________�

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


__________�

View the list's information and change your settings at 
http://www.freelists.org/list/jawsscripts

Other related posts: