开发者

Combining two statements

How do I combine these two statements?

e.onerror=i3d;function i3d(a){a.src='http://www.archemarks.com/favicon1.ico';}

e.onerror expects a reference to a function, but I just need to one statemen开发者_运维问答t as shown above.


Although I'd hardly call it much of an optimization, you can assign the function directly to the event handler...

e.onerror = function() { /* do something */ };


Is this what you want?

e.onerror=function(a){a.src='http://www.archemarks.com/favicon1.ico';};
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜