It would be nice to have the following options.

  • Serve latest 1.x version to all browsers
  • Serve latest 2.x version to all browsers
  • Serve latest 1.x version to IE<9, and latest 2.x to all other browsers

See http://blog.jquery.com/2013/03/01/jquery-2-0-beta-2-released/

If you’d like to try jQuery 2.0 on web sites where you still need to support IE 6, 7, and 8, you can use conditional comments. All browsers except old IE will get the second script and ignore the first:

<!--[if lt IE 9]>
    <script src="jquery-1.9.1.js"></script>
<![endif]-->
<!--[if gte IE 9]><!-->
    <script src="jquery-2.0.0b2.js"></script>
<!--<![endif]-->

Comments

klonos’s picture

klonos’s picture

Title: Options for serving jQuery 2.x » Offer latest jQuery 2.x as an option (currently 2.0.3) - Fall back to 1.x for IE6/7/8.
alberthendriks2’s picture

This fix seems doable. However the question is: how will the rest of Drupal behave with jquery 2? They say the api is the same, so it should work. But did anybody try?

edit (after #4 was posted): I'm sorry but it was decided not to use jQuery 2 for our project.

klonos’s picture

...the question is: how will the rest of Drupal behave with jquery 2?

I'm willing to test as I'm pretty sure some others would be too if the option was available in the dev version. If we test, we'll find out and report any bugs as they come up. They'll eventually be fixed ;)

klonos’s picture

Component: Code » jQuery 2.x.x
klonos’s picture

Title: Offer latest jQuery 2.x as an option (currently 2.0.3) - Fall back to 1.x for IE6/7/8. » Offer latest jQuery 2.x as an option (currently 2.1.0) - Fall back to 1.x for IE6/7/8.
Issue summary: View changes
xbery’s picture

Status: Active » Needs review
StatusFileSize
new1.35 MB

Hi,

here is a patch that allows you to select jQuery 2.0.0 or jQuery 2.1.1. I have also included the jQuery migrate plugin that can be optionaly included to simplify the migration to jQuery 2+.

Lukas

markhalliwell’s picture

Version: 7.x-2.x-dev » 7.x-3.x-dev
Status: Needs review » Needs work

This will likely need a little work with the addition of #1969244: Specify jQuery version per theme.

Also, moving to 7.x-3.x.

supermoos’s picture

Any word on when this will be in 7.x-3.x, and when it get's released?

markhalliwell’s picture

No. As I stated above, this will need to be re-rolled against the current 7.x-3.x branch.

tvl’s picture

Thanks for the effort. Any news on that?

robloach’s picture

Status: Needs work » Fixed

Left out the conditional IE stuff. Let's battle that in a different issue. 7.x-3.x

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.