Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript [Solved] jquery.done()method throwing errors

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #197387
    colette
    Participant

    I’m having trouble using the jquery.done() method and hope an extra pair of eyes can see what the problem is. I tried rearranging my code but that didn’t work out too well. I’m also novice to Javascript and getting the hang of it slowly.

    Ultimately, I would like to use this to remove a pre-loader when the ajax requests are done and all elements are on the page.

    http://jsfiddle.net/jzm1g8wz/

    #197405
    Shikkediel
    Participant

    I think the issue is that .done() is a method that cannot be used on a regular jQuery object but only in the context of an Ajax request. Had to google a bit myself (not too familiar with this part) but it looks like the .promise() method is what you are looking for.

    #197409
    colette
    Participant

    Yea. I tried putting it within the ajax request, which resulted in a bunch of calls to the API that exceeded my usage. I’m going to look into .promise().

    Thanks

    #197413
    colette
    Participant

    So I re-read the docs and figured it out. All I had to do was chain .done to the ajax request. Hopefully this helps someone else needing something similar.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘JavaScript’ is closed to new topics and replies.