0

I'm developing and App in AngularJS, this application has a page that must be used by people with Internet Explorer 8 (maybe older).

Will using only Jquery instead of Angular + Jquery (because I know Angular requires Jquery) make the page more internet explorer friendly? Or would I lose more than I gain in functionality?

almulo
  • 4,918
  • 1
  • 20
  • 29
  • 2
    jQuery has better support for legacy IE than Angular does, for sure. But jQuery and Angular are two very different things. What specifically are you needing to do in IE 8 (and maybe older)? – Sampson Jan 06 '15 at 19:10
  • Do you prefer apples or oranges? – Ruan Mendes Jan 06 '15 at 19:11
  • i want to render a dynamic survey stored in a mongoDB collection and retreive the results – user3877179 Jan 06 '15 at 19:50
  • @user3877179 Still very difficult to answer your question without far more details, and code. The short answer though is "Yes," using jQuery instead of Angular does make your app more friendly to IE 8, since [Angular 1.3+ doesn't support IE 8](https://docs.angularjs.org/guide/ie). – Sampson Jan 06 '15 at 22:12

1 Answers1

0

To start the answer, Angular doesn't actually require jQuery. It has a built in version called jQuery lite or jqLite-

jqLite is a tiny, API-compatible subset of jQuery that allows Angular to manipulate the DOM in a cross-browser compatible way. jqLite implements only the most commonly needed functionality with the goal of having a very small footprint.

To return to the compatibility issues that form the thrust of your question.

Angular JS documentation specifically states that Internet Explorer 8 is not supported from version 1.3 onwards -

AngularJS 1.3 has dropped support for IE8. Read more about it on our blog. AngularJS 1.2 will continue to support IE8, but the core team does not plan to spend time addressing issues specific to IE8 or earlier.

On the subject of Internet Explorer compatibility it also states-

The project currently supports and will attempt to fix bugs for IE9 and above. The continuous integration server runs all the tests against IE9, IE10, and IE11...

We do not run tests on IE8 and below. A subset of the AngularJS functionality may work on these browsers, but it is up to you to test and decide whether it works for your particular app.

Source for both - Internet Explorer Compatibility, Angular JS Developer Guide

Given the substantial API and DOM changes between versions eight and nine of Internet Explorer - I'd not be surprised to find Angular 1.3 produces errors simply by being included in a page in Internet Explorer 8, although the abstractions provided with a version of jQuery from the 1.X branch may prevent issues provided that this is loaded before Angular JS (or at least before the DOMContentLoaded event is fired) thus ensuring it is used in place of the built-in jQuery lite provided with Angular JS. Given the DOM selector and event binding functions incorporated into jqLite this is presumably the most likely source of compatibility issues.

If your application needs to run in Internet Explorer 8 you would be wise to use the most recent legacy 1.2 version - 1.2.28 at the time of writing.

jQuery should be safe for your project providing you use the 1.x branch and not the streamlined 2.x branch, it has an excellent page on browser support should you wish to confirm this.

At the time of writing the 1.x branch maintains support back to Internet Explorer 6, and is unit tested against that browser. The 2.x branch features an identical API, but removes support for versions of Internet Explorer prior to 9 - to reduce the non-standard Internet Explorer API workarounds required for jQuery methods to work.

Looking forward to the 3.x releases, the split 1.x/2.y with identical APIs will be replaced by a single 3.x version number - and a separate "compatibility" branch/file will be simultaneously available for supporting a wider range of browsers. In the blog post announcing the release Internet Explorer 8 is specifically name-checked as being supported and with Internet Explorer 8 still enjoying between 3.43 and 5.49% based on current StatCounter data - you should still be safe using jQuery in your project for the foreseeable future.

Short answer

jQuery offers very different functionality to Angular JS and - although it is possible to rewrite an AngularJS app to only use jQuery, it will be much more verbose to achieve some behavior. I'm not going to go into the details of what makes Angular JS different from jQuery here, instead refer your to their Developer Guide Introduction.

The jQuery library enjoys much wider cited compatibility than AngularJS, but version 1.2 of AngularJS does still support Internet Explorer 8. If you want to use Angular then you should be able to safely do so using that version if Internet Explorer 8 is the earliest version you are required to support.

If you want the widest possible compatibility then you should use jQuery and not Angular JS for your application. With Internet Explorer 6 and 7 only enjoying 0.36% usage globally combined in Decemember 2014 though, Angular would seem a justifiable decision should you wish to use it.

As always, examine your target market/demographic for requirements before relying on global statistics.

Community
  • 1
  • 1
pwdst
  • 13,909
  • 3
  • 34
  • 50