0

I am tinkering around with some third party code and this caught my attention:

spimg[x] = new Image();
spimg[x].onerror = function () {
    var t = 1;
    while (t < 7) { t++ }
};
spimg[x].src = imageSrc;

After trying to load an image, if an error ocurrs, it just sets up an empty loop that finishes quite quickly.

What could be the use of such an error function?

Alpha
  • 7,586
  • 8
  • 59
  • 92

0 Answers0