Note that there are some explanatory texts on larger screens.

plurals
  1. POFineUploader onComplete not firing with CoffeeScript
    primarykey
    data
    text
    <p>I'm creating my first project with FineUploader using Node.JS, Express, and CoffeeScript. Everything is working perfectly so far, with one exception. After the upload completes, I am returning a JSON object containing the success variable, as well as one other variable that is necessary to proceed. Unfortunately, I cannot successfully get the onComplete callback to fire. I believe all of my code is correct, and the Chrome console is not throwing any errors. I have also tried printing to the Chrome console in the onComplete method, but to no avail. Any assistance would be greatly appreciated.</p> <pre><code> uploader = new $("#collaboration-fine-uploader").fineUploader autoUpload: false multiple: false validation: allowedExtensions: ['pdf', 'doc', 'docx', 'ppt', 'pptx', 'xls', 'xlsx'] sizeLimit: 1024*1024*1024*10 # 10MB text: uploadButton: "&lt;i class='icon-plus icon-white'&gt;&lt;/i&gt; Select Files" request: endpoint: "/files/discussions/collaborations/upload" callbacks: onComplete: (id, fileName, responseJSON) -&gt; if (responseJSON.success) alert "response success" discussionId = responseJSON.discussionId $.ajax type: "GET" url: "/courses/"+serverData.course._id+"/discussions/"+discussionId beforeSend: (xhr) -&gt; xhr.setRequestHeader 'x-pjax', 'true' success: (html) -&gt; # Replace the old html $(".discussions-tab").html html $(".new-discussion").slideUp() $("#new-discussion-modal").deactivateModal() # History push window.history.pushState window.history.state, "Discussions", "/courses/"+serverData.course._id+"/discussions/"+discussionId # Scroll to top $.scrollTo 0 $(".trigger-upload-and-submit").on "click", (e) -&gt; e.preventDefault() uploader.fineUploader "setParams", discussion: title: $(".new-collaboration .discussion-title").val() body: $(".new-collaboration .discussion-body").val() groupId: serverData.course._id showProfessors: $(".new-collaboration .show-professor-checkbox").attr("checked") showStudents: $(".new-collaboration .show-students-checkbox").attr("checked") type: "Collaboration" uploader.fineUploader("uploadStoredFiles") </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload