onError: Set an event handler called when there's an error.
The onError property is used to set an event handler to be called when the DLM encounters an error.
The code shown below was run when this page loaded. The file to be downloaded doest not exist on the server and the attempted download will generate a custom error message. The dlmContainer and startDLM HTML elements are already defined in this page.
Click the Start Download link to begin. If you haven't installed the NetSession client, you'll be prompted to download and install it first.
Code
function errorHandler() {
alert("There was a problem with your download.
If you need assistance please contact Technical Support
by email at the following address: support@yourcompany.com");
}
var url = "http://client.akamai.com/install/test-objects/nope.bin";
var dlm = new DLM(DLMCID, url, null, "dlmContainer", "startDLM");
dlm.downloadPath = "prompt";
dlm.onError = errorHandler;
