Fix jQuery 1.8 deprecations

This is a fix for #4018. It corrects the deprecations listed there.