Add compatibility for JQuery 2.x

Add compatibility for JQuery 2.x