frontend - What is this JavaScript hack? -
i found code in javascript, , wondering if kind of hack, or mistake :
var img = new image(); img.src = myhttpsrc; img.onload = function () { img.onload = null; };
the code seems load image myhttpsrc. there event handler onload triggered when loaded. handler removing once load completed.
this not hack, onload handler not doing other removing seems redundant.
Comments
Post a Comment