阅读:1486回复:2
为什么Greasemonkey中这句无效?
document.getElementById("my1").click()
错误提示 document.getElementById("my1").click is not a function |
|
1楼#
发布于:2007-11-08 18:06
GM用XPCNativeWrapper对很多对象进行了包装。所以,有些访问方式不能工作正常。
比如:
详细内容,可以查看http://wiki.greasespot.net/XPCNativeWrapper。 如果你要定义一个功能可以试试下面的方式: var e = document.getElementById("id"); |
|
2楼#
发布于:2007-11-08 18:06
我不是要定义,我是要调用这个方法,因为直接调用html里面的脚本函数出错
不过基本解决了,我用document.body.setAttribute("onload","javascript:XXX")把调用写上去了 |
|