Updated the script to work with jQuery >= v1.9. Fixes #82