- This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- The forum ‘JavaScript’ is closed to new topics and replies.
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
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.
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.
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
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.