Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Simulating Mouse Click on a Client Side Image Map

 
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?
 
author
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.
 
Can you smell this for me? I think this tiny ad smells like blueberry pie!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic