Skip to main content

Bug Tracker

Side navigation

#13816 closed feature (notabug)

Opened April 24, 2013 07:21AM UTC

Closed April 28, 2013 04:37PM UTC

Provide a way to easily check if the browser is compatible with the used version of jQuery

Reported by: Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 2.0.0
Keywords: Cc:
Blocked by: Blocking:

At the moment jQuery 2.0 can be used with no real drawbacks, as oldie compatibility can be easily provided by using

''IE conditional comments''.

I have read in the jQuery 2.0 release announcement that there is a plan to drop old android browser support.

I personally use a custom android 2.3 rom on my phone (as it provides ''humongous'' battery life), and I use the stock browser from time to time (as it renders more consistently than opera mini, and is smoother than all other alternatives).

I have realized that I will not be able to use jQuery 2.0 and still fall back 1.9 on old android browsers as easily as conditional comments go.

Please provide a solution for this.

For example using yepnope like this would be great:

  test : jQuerySupport('2.0'),
  yep  : 'jquery.2.0.0.min.js',
  nope : ['polyfill.js', 'wrapper.js']
Attachments (0)
Change History (3)

Changed April 24, 2013 07:29AM UTC by comment:1

I cannot edit my code as I'm posting as anonymous but clearly I wanted to write:

  test : jQuerySupport('2.0'),
  yep  : 'jquery.2.0.0.min.js',
  nope : 'jquery.1.9.1.min.js'

or since yepnope is usually used in the modernizr bundle:

  test : jQuerySupport('2.0'),
  yep  : 'jquery.2.0.0.min.js',
  nope : 'jquery.1.9.1.min.js'

Changed April 27, 2013 11:46AM UTC by m_gol comment:2

owner: →
status: newpending

It's not possible to easily test if a particular browser is supporting jQuery code enough so that it should work. The only way to do what you ask for is to use user agent sniffing which is a definite no-go in jQuery core.

If you see any other way to do it, please post, but IMHO this is a wontfix.

Also, note that we didn't say Android 2.3 will soon be dropped, we'll wait for its user share to drop significantly first which will take some time.

Changed April 28, 2013 04:37PM UTC by dmethvin comment:3

resolution: → notabug
status: pendingclosed

At the moment, older Android is supported so it's a little early to talk about how to do something we don't need to do.

As the author of the page, you should either ensure that there are no oldIE users or use jQuery 1.9 when appropriate. As far as a last-ditched "you're screwed" message, a quick check might be:

if ( window.attachEvent && !window.addEventListener ) {
    "Your browser won't work with this site.\\n"+
    "Contact the site to ask if they support your browser."

There isn't much that can be done if jQuery 2.x is loaded for oldIE, it just won't work and won't even initialize properly.