• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simulating Mouse Click on a Client Side Image Map

 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never had to do it, can I ask why you need to do this? Might be a better solution.

Eric
 
Alec Lee
Ranch Hand
Posts: 569
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic