new code path for compatibility with jQuery 2.0+