Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IE 8 Quirks vs Standards retrieving offsetHeight/offsetWidth

I am in the process of converting my application to use XHTML strict mode (it didn't have a DOCTYPE before). However, I noticed a significant degradation when getting offsetHeight/offsetWidth. This is very noticeable on pages with large number of DOM elements, let's say a table with 1 column by 800 rows, the cells only have a piece of text. Visiting each descendant element in that table to obtain their offset dimension is way slower than when IE renders the page in Quirks mode. Why is that the case? and does anybody know tips to help IE calculate those offsetValues?

like image 338
Paul Avatar asked Oct 25 '22 08:10

Paul


1 Answers

I would suggest to force IE to render you page in standards mode not in quirks. This can be done by adding a meta tags on the head of your html document or setup the web-server to add X-UA-Compatible headers.

<meta http-equiv="X-UA-Compatible" content="IE=8;FF=3;OtherUA=4" />

Also, use built-in javascript frameworks such as jquery,prototype, yui, etc, most be of them already addressed the issues on different rendering engines.

like image 106
jerjer Avatar answered Nov 29 '22 07:11

jerjer