1

I need to know what can be the main reasons (apart from the basics like grouping CSS selectors, reducing image size, using image sprite etc.) which makes a website slow on Internet Explorer, because my website works fine on the others like FF, chrome etc.

  1. Is it the huge use of Javascript framework (ie. jQuery, extjs, prototype)?
  2. Is it because of the use of plugins based on JS framework?
  3. Should I use core javascript and remove the use of any js framework?
  4. Should I try to avoid using jQuery(document).ready()? in case of jQuery framework?

Above some of the questions which I know and please answer the questions which I couldn't ask because of lesser knowledge about these.

I need to make my website perform well on IE (6,7,8) also please suggest.

Thanks

5
  • 1. Which versions of IE is your site slow in? 2. How is it slow? Slow to display anything on the page? Slow to display everything on the page? Slow to interact with? Dec 27, 2010 at 12:50
  • 1. IE 6 is very slow, IE 7,8 are slow at same rate. 2. don't know, may be JS. slow to display everything from loading to interacting.
    – Bhupi
    Dec 27, 2010 at 13:32
  • IE9 is also not really the fastest. So the answer "because it's IE" is not that far off.
    – KooiInc
    Dec 27, 2010 at 14:00
  • lifehacker.com/5711040/…
    – KooiInc
    Dec 27, 2010 at 15:44
  • I am not finding any reason for down vote... if there is any.. pls tell me at least :)
    – Bhupi
    Dec 28, 2010 at 6:46

4 Answers 4

3

It has nothing to do with jQuery. The plugins however are hit or miss, and may not be well tested in IE. I'd use at your own risk.

DOM manipulation is very slow in IE. using appendChild (or insertRow) to add multiple nodes (say, 100+ for a long list) is much slower than building a string and doing one innerHTML.

You also want to be careful how you access nodes. Devs tend to rely upon jQuery too much and search for nodes via their class names, like:

$(".evenRows").hover(doSomething);

IE doesn't have a native way of getting a node by class name, so JQ is looping through the entire document and every single element and checking its class name... which needs to be checked via RegExp because it may look like:

class="evenRows yellow foo bar"

Finally, in spite of its improvements, IE8 is still using an old rendering engine - the same as IE6. Don't go crazy with the animations, and don't expect miracles.

2

As MSIE has a default-limit of 2 simultaneous connections you should minimize the number of requests that are required for building the page(use css-sprites, merge js-and css-files into a single file)

2
  • 1
    This is true for non-scripts in IE6 & 7; for scripts it's one at a time. IE8 will load 20 resources at a time, but loads scripts separately.
    – mwilcox
    Dec 27, 2010 at 12:40
  • IE8 and above use 6 parallel connections per server. IE8+ will also not block download of CSS/Script while executing script.
    – EricLaw
    Dec 27, 2010 at 15:02
2

While you need to speed things up in IE, you can still use Firebug to look for places, that consume resources.

  • Install Yslow and see what it tells you
  • Run the site under profiler (Yslow or Firebug have one) and look for a bottleneck

It is very difficult to answer general questions like this, but jQuery is unlikely to be the one slowing everything down, just remember to

  • Use IDs as selectors wherever possible — they are the fastest, i.e. $('#myid')
  • Avoid using .class selectors without tagname, i.e. $('div.myclass') can be ten times faster than $('.myclass').

and so on

More tips for using jQuery to achieve better performance.

0

Earlier versions of IE will, in general, run JavaScript slower than later versions of IE, because there have been advances in JavaScript compilation speed since then.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.