abort Method

Summary

Aborts the current ImageLoader while guaranteeing that callbacks for Done, Fail, and Always will not be run.

Syntax
TypeScript
JavaScript
ImageLoader.prototype.abort = function() 
abort(): void; 
Remarks

Abort will silently cancel the request, regardless of whether Run has been called. After Abort is called, the ImageLoader is permanently unusable and IsAborted will be true.

Abort will not cause any public result callback events (Done, Fail, or Always) to be run. ImageLoaderPreRunEventArgs.Cancel and ImageLoaderPreSendEventArgs.Cancel, which are available from the PreRun and PreSend events respectively, will cause the Fail and Always callback event to run. This means that after the actual request is sent, only an actual request error will cause Fail to be run.

Dispose, which is called internally after the Always callback runs, calls Abort. Unlike Dispose, Abort will not explicitly clear references to properties such as WorkingImageElement, Xhr, Url, Error, etc. For this reason, Dispose is preferred over Abort in most cases to truly clean up the ImageLoader.

Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.