Re: Simulating clicks on the DOM node of the GMAIL page.

"Amit Saurav" <[email protected]>
Newsgroups gmane.comp.mozilla.devel.dom
Message-ID <[email protected]>
Hi Neil,

The problem with the gmail page is that, there are no <a> hrefs so
that I could take out the target url. All the clickable nodes on the
page are normal span tags.

Another observation that I would like to highlight is, for the texts
on the side bar of gmail (Eg: Compose, Inbox, Sent Items, etc...), I
am able to dispatch the click event, even if they too ar span tags.
But for the text of the actual emails, which again are span tags, i am
not able to do so :(. The difference that i noticed in the two span
tags is, one has an attribute called ROLE = "link" and the other does
not. I read somewhere that ROLE attribute is supposed to be an ARIA
standard. But how does it affect the lower level dispatchEvent on the
DOM??

Am i missing somethin? Thanks a lot for your help...

Regards,
Amit

On Wed, Feb 27, 2008 at 9:20 AM, Neil Deakin <[email protected]> wrote:
> Amit Saurav wrote:
>  > Thanks for the pointers... :)
>  >
>  > Here are the details:
>  >
>  > Consider the situation:
>  > <span>
>  >    <a>
>  >       To click
>  >    </a>
>  > </span>
>  >
>  > Whenever I call the dispatchEvent on the <a> tag, my click is
>  > simulated as expected. But when i call the dispatchEvent on the <span>
>  > tag, the link is not followed.
>
>  If you are trying to just open the link's url, you should just set
>  document.location = link.href
>
>
>  Does the dispatchEvent depend upon the
>  > type of DOM node? That is, can the click event be simulated only on
>  > elemnts which are actually clickable by default (like <a> etc)? Cant
>  > it be simulated on "any" element in the DOM?
>
>  dispatchEvent will work on any element and will dispatch a DOM event to
>  the element you targeted. It won't activate the link though since you
>  didn't target it.
>
>
> _______________________________________________
>  dev-tech-dom mailing list
>  [email protected]
>  https://lists.mozilla.org/listinfo/dev-tech-dom
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.