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';};
精彩评论