aspose file tools*
The moose likes HTML, CSS and JavaScript and the fly likes Simulating Mouse Click on a Client Side Image Map Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Simulating Mouse Click on a Client Side Image Map" Watch "Simulating Mouse Click on a Client Side Image Map" New topic
Author

Simulating Mouse Click on a Client Side Image Map

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
I know in general, to simulate an event for an object, we invoke that object's fireEvent() in IE or dispatchEvent() in FF.

But, I need to simulate a mouse click using IE on a client side image map. Which object should invoke the fireEvent()? It cannot be simply the [area> object since it could be referenced by 2 different [img>'s. It cannot be the [img> since we need a way to tell which part of the img is clicked which is defined in the [area] tag?

I've done some test with real mouse click on an client side image map. The event object generated from my click indicates (by the event.srcElement property) the event is generated from [area> tag. But when I tried to programmatically call the [area>'s fireEvent(), nothing happened!

Does IE actually support simulating click on a client side image map?
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Never had to do it, can I ask why you need to do this? Might be a better solution.

Eric
Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
Some web automation tool. Basically I am writing my javascript in a .hta file (html application) and windows would run it as if it is an application with all security disabled, in particular the same origin policy. That means after my newwin=window.open(someUrlofMyChoise,..), I can have the full DOM under "newwin" at my mercy including sending mouse event of my choice to it.

I know web unit test framework Selenium is using this approach for unit testing under IE.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simulating Mouse Click on a Client Side Image Map
 
Similar Threads
repainting JLabels on a JPanel
how to make image rollover in awt.
Help me, please!
Any information about ImageMap ?
HTML Client-Side Image Map