开发者

Onclick action from html to firefox add-on

I have a function in the add-on and I have an image in the page. How can I call that function from the add-on when the user 开发者_Python百科click on the image?

<img src='something' onclick="thisfunction();"> //what is need to call thisfuntion function in the add-on?
//in the add-on:
function thisfunction(){ .... }


Is that HTML code you inject into the web page? Then you should attach an event listener:

img.addEventListener("click", thisfunction, false);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜