Copied from jQuery 1.8, the last jquery version with browser recognition support.