Search code examples
jqueryfine-uploader

How do I display a fine-uploader error message in a div?


In my application there is an option to skip the upload if the image exists. If this happens I want to display an error in a div instead of in a popup alert box. In the docs it gives this example which works for the alert box:

callbacks: {
 onError: function(id, name, errorReason, xhrOrXdr) {
  alert(qq.format("Error on file number {} - {}.  Reason: {}", id, name, errorReason));
  }
}

How would I display the same message inside a div on the page using jquery? Such as:

<div id="error"></div> 

I've tried a few things but just get js errors. I'm not a jquery/js guru, so any help is much appreciated!


Solution

  • I just wanted to put an answer up for this because Karthik's comment worked perfectly.

    "Replacing alert with

    $("#error").text(qq.format("Error on file number {} - {}. Reason: {}", id, name, errorReason)) 
    

    should work – Karthik Ganesan"