<<span id = "test" style="CURSOR: hand" onclick="javascript:addMSN("[email protected]");"><img src="images/kf_msn.gif" width="18" height="18">客服一</span>\
//如果要在脚本中触发事件:
<script language="javascript">
document.all.test.onclick();
</script>

解决方案 »

  1.   

    onclick="javascript:addMSN("[email protected]");"onclick="javascript:addMSN([email protected]);"引号要匹配的   "javascript:addMSN("  
      

  2.   

    onclick="javascript:addMSN('[email protected]');"
      

  3.   

    sorry!
    <span style="CURSOR: hand" onclick="javascript:addMSN(\\"[email protected]\\");">
    or
    <span style="CURSOR: hand" onclick="javascript:addMSN(\'[email protected]\');">
      

  4.   

    <span style="CURSOR: hand" onclick="javascript:addMSN('[email protected]');"><img src="images/kf_msn.gif" width="18" height="18">客服一</span>
      

  5.   

    document.write('\
    <div id="myleft" style="position:absolute; width:133px; height:115px; z-index:1; 我是在脚本中调用的,victor26(漂流纸船) 说如果要在脚本中触发事件:<script language="javascript">
    document.all.test.onclick();
    </script>
    那触发的函数addMSN('[email protected]') 怎么调用。大家来看看。
      

  6.   

    onclick="javascript:addMSN("[email protected]");" 改成onclick="javascript:addMSN(\"[email protected]\");"试试。或者改成onclick="javascript:alert(1);"试试这里究竟能否触发,如果不能错误在其他地方。