Fix reference to (possibly undefined) global variable jQuery

We should be using the local copy of jQuery `$` like everywhere else instead of relying on a global variable which may or may not exist.