Hello,

I've created a very simple Image Gadget to which I am trying to add Image 
Map functionality so users can click on image hot spots and a Javascript 
function will execute. The user supplies a URL for their image as a 
UserPref, so I need to keep the image map functionality generic so users can 
create their own image maps.

What I've come up with so far is that a JSON object containing the image map 
information will be passed to the Gadget via an RPC call. So far so good. 
Everything works if I use the following JSON:

{
          name: "tabs",
          areas: [
            {
              shape: "rect",
              coords: "910, 9, 960, 33",
              title: "Failed",
              alt: "Failed",
              href: "javascript:alert('Failed')"
            }
]}

I build an image map from the JSON and insert it into the DOM of the Gadget.

The problem is that I would like to execute some other Javascript function 
when an image hot spot is clicked. For example, instead of 

javascript:alert('Failed') 

I would like to call something like

javascript:showDiv(showId);hideDiv(hideId);

or something similar. The showDiv function is defined outside of the Gadget, 
so I receive an error when I try to execute that. I do not want to put it 
inside of the Gadget because someone else that uses my Gadget might have 
some other Javascript function they'd like to run when the image map is 
clicked.

Any thoughts on how I can do this?

Much thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"iGoogle Developer Forum" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/Google-Gadgets-API?hl=en.

Reply via email to