Fixed issue with jquery 1.9+

Changed .error() to .on('error',function). Fixes issues with jquery 1.9+