在线活动注册或。高级注册图像验证

时间:2011-08-16 17:48:46

标签: javascript

如果我使用类似于

的代码,内联事件注册可以正常工作
onerror=function(this) // in xhtml placed in element

然而,高级事件注册不起作用,即

a.onerror=function(this) // where a. is the element in javascript

当我想在失败时正确地将this.src更新为新图像。

1 个答案:

答案 0 :(得分:0)

需要使用addEventListener