@tdw ,
What was announced as deprecated was jQuery UI, which depends on, but is not the same as jQuery. In several places, there have been comments that jQuery will be available to people by the time their custom code is executed. If Instructure is deprecating jQuery, I completely missed that discussion but I probably would have seen the backlash from it somewhere in the Community. Canvas would like to get rid of jQuery eventually, since they have moved to ReactJS, but there is a lot of code there that still uses it and it will be around for a long time.
That said, there is a potential problem with the loading order. jQuery is supposed to be available, but there is no guarantee that the content of the page will be available when the jQuery is executed. This is a bigger issue now that Canvas has taken efforts to optimize the loading of files to speed up the process.
In particular, the content of pages is delivered as part of the JavaScript and not necessarily available in the DOM when the function becomes available.
In more direct terms, there may not be anything for jQuery to add an event listener to when it tries. jQuery masks the error messages when elements aren't available, so you may not notice it the way you would if you were using straight JavaScript.
You should make sure that the items are on the page before you try to listen to them. There are several ways to do that. Mutation Observers are probably the best way to do that; others have tried waiting an preset amount of time for them to show up.
One of the conversations about it is What is the best way to run javascript after all content is loaded on the page? Here's another from when I first discovered the issue: https://community.canvaslms.com/message/32791 There are some other discussions about it as well, that might give an idea of where to go.
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.