我在插件中有一个函数,我在页面中有一个图像。当用户单击图像时,如何从附加组件调用该函数?
<img src='something' onclick="thisfunction();"> //what is need to call thisfuntion function in the add-on?
//in the add-on:
function thisfunction(){ .... }发布于 2011-09-04 17:56:34
你注入到网页中的是HTML代码吗?然后,您应该附加一个事件侦听器:
img.addEventListener("click", thisfunction, false);https://stackoverflow.com/questions/7288106
复制相似问题