前端代码
   <img id="Image1" class="map" src="upload/ProjectImages/1.jpg" width="1000" border="0"
                    usemap="#usa" />
                <map name="usa" id="map1">
                  
                </map>
后端希望通过一个事件在图片上相应的地点添加一个红点
addEvent(container, 'click', function(ev) {
    if (document.getElementById('txtCursorPoints') != null) {
        var cursorPos = getMousePoint(ev);        $("#map1").append("<p>here</p>");
        $("#map1").append("<area shape='circle' coords='296,388,9'/>");        var CursorPointsValue = document.getElementById('txtCursorPoints').value;
        if (CursorPointsValue == "")
            document.getElementById('txtCursorPoints').value = cursorPos.x + "," + cursorPos.y;
        else {
            document.getElementById('txtCursorPoints').value = CursorPointsValue + "," + cursorPos.x + "," + cursorPos.y;
        }
    }
});
但是发现根本没有添加红点 应该怎么做有哪位达人帮忙下~谢了。

解决方案 »

  1.   

    $("#map1").append("<area shape='circle' coords='296,388,9'/>");好像没效果
      

  2.   


    我知道怎么添加area,
    var obj=document.getElementById("map1");
    obj.innerHTML="<area shape='circle' coords='180,139,14' href ='venus.html' alt='Venus' />";至于红点,弄不上去,没有颜色属性,怎么加上的呢?
      

  3.   

    是啊 如何为area加上颜色,这个确实是一个头痛的问题 有没有人知道啊?