core/responsive-image.js
function loadImageForBreakpoint(image, s) {
  var alreadyLoaded = image.loadedSizes[s];

  if ('undefined' !== typeof alreadyLoaded) {
    setImage(image, alreadyLoaded);
  } else {
    var img = new Image();

    img.onload = function() {
      image.loadedSizes[s] = img;
      setImage(image, img);
      update(image);

      image.hasRunOnce = true;
    };

    // If requesting retina fails
    img.onerror = function() {
      if (image.hasRetina && !image.hasLoadedFallback) {
        image.hasLoadedFallback = true;
        var path = image.getPath(image, s, false);
        if (path) {
          img.src = path;
        }
      } else {
        image.trigger('error', img);
      }
    };
    
    var path = image.getPath(image, s, image.hasRetina);

    if (path) {
      img.src = path;
    }
  }
}
function loadImageForBreakpoint(image, s) {
  var alreadyLoaded = image.loadedSizes[s];

  if ('undefined' !== typeof alreadyLoaded) {
    setImage(image, alreadyLoaded);
  } else {
    var img = new Image();

    img.onload = function() {
      image.loadedSizes[s] = img;
      setImage(image, img);
      update(image);

      image.hasRunOnce = true;
    };

    // If requesting retina fails
    img.onerror = function() {
      if (image.hasRetina && !image.hasLoadedFallback) {
        image.hasLoadedFallback = true;
        var path = image.getPath(image, s, false);
        if (path) {
          img.src = path;
        }
      } else {
        image.trigger('error', img);
      }
    };
    
    var path = image.getPath(image, s, image.hasRetina);

    if (path) {
      img.src = path;
    }
  }
}
function loadImageForBreakpoint ( image , s ) { var alreadyLoaded = image . loadedSizes [ s ] ; if ( 'undefined' !== typeof alreadyLoaded ) { setImage ( image , alreadyLoaded ) ; } else { var img = new Image ( ) ; img . onload = function ( ) { image . loadedSizes [ s ] = img ; setImage ( image , img ) ; update ( image ) ; image . hasRunOnce = true ; } ; // If requesting retina fails img . onerror = function ( ) { if ( image . hasRetina && ! image . hasLoadedFallback ) { image . hasLoadedFallback = true ; var path = image . getPath ( image , s , false ) ; if ( path ) { img . src = path ; } } else { image . trigger ( 'error' , img ) ; } } ; var path = image . getPath ( image , s , image . hasRetina ) ; if ( path ) { img . src = path ; } } }
Load the requested image.
@param {ResponsiveImage} image The ResponsiveImage instance.
@param {String} s Filename.
Load the requested image .