Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide two versions of jQuery: one for old, one for new #1376

Closed
mrmartineau opened this issue Jun 10, 2013 · 4 comments
Closed

Provide two versions of jQuery: one for old, one for new #1376

mrmartineau opened this issue Jun 10, 2013 · 4 comments

Comments

@mrmartineau
Copy link

As you know jQuery v2x loses browser support for oldIE and is now about 10% smaller in filesize. We can reduce page weight to users with more modern browsers by providing a conditional comment that separates the two versions so that oldIE gets v1x and modern browsers get v2x.

<!--[if lte IE 8]>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js"></script>
    <script>window.jQuery || document.write('<script src="/js/libs/jquery.min.js"><\/script>')</script>
<![endif]-->
<!--[if gt IE 8]><!-->
    <script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2jquery.min.js"></script>
    <script>window.jQuery || document.write('<script src="/js/libs/jquery.2.min.js"><\/script>')</script>
<!--<![endif]-->

Also see this gist as an example or my blog post about it

@pierrepavlov
Copy link

Isn't there chance for errors if the two versions differ too much?
I mean, you would almost need to make the same thing for main.js (if that is where you're writing your scripts).

I haven't really read about how much the version will differ except for the old IE-support, so please correct me if I'm wrong!

@necolas
Copy link
Member

necolas commented Jun 10, 2013

Thanks, but since we can't rely on 2.x and 1.x to be identical, this isn't something I think we should include.

@necolas necolas closed this as completed Jun 10, 2013
@FagnerMartinsBrack
Copy link
Contributor

For reference: #1353 (comment)

@mrmartineau
Copy link
Author

Thanks @FagnerMartinsBrack, I hadn't seen that. On reflection, I think @necolas is right to ignore this but I still think that it can be useful to some developers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants