Runs the ImageLoader.
ImageLoader.prototype.run = function(
)
run(
): void;
The Run method begins the process of loading the image from Url. The ImageLoader will first call the PreRun event callbacks, and if Cancel is set to true then the Fail callbacks will be called. After this, IsWorking will be true.
How the image is loaded will be determined by the value of UrlMode (see ImageLoaderUrlMode for a comparison of these different methods). A request is created, and if using AJAX then AjaxOptions will be added to the request. The image load then begins. When the load completes, the Done or Fail (and in either case, Always) events will fire depending on the result. If successful, the Width, Height, IsHTMLImageElement, and Element properties should all have correct values. Otherwise, Error will contain an error.
Depending on the presence of ImagesHolder and the type of image being loaded, the image may temporarily be added to the DOM. If this is the case, the image will be automatically removed when the image is appended somewhere else.
If the UrlMode is ImageLoaderUrlMode.AjaxDataUrl or ImageLoaderUrlMode.AjaxXml and the result image is
an HTML Image Element (IsHTMLImageElement is true), there is the chance that the
src
attribute of Element will not be equal to the original Url; instead it may be a data/blob URI.
If the Url to be loaded is a data URI, it will always be loaded as ImageLoaderUrlMode.ImageUrl.