我有这个地图区域。
HTML:
<area shape="rect" coords="211,38,238,60" onclick="cancel()">
function cancel()
{
}
现在我该如何在对象中执行此操作?
JS:
var images = {
dosomething: {
path: 'asdf.jpg',
areas: [{
coords: '211,38,238,60',
text: 'dosomething',
onclick: cancel() // like this ?
}]
},
}