Quantcast
Channel: Internet Explorer Web Development forum
Viewing all articles
Browse latest Browse all 3527

IE9 and IE10 array iteration issues

$
0
0

Hello everyone,

I am facing performance issue on IE9 and IE10 browsers while iterating over loop ( for around 20 K records).

This is the blog   http://blog.n01se.net/blog-n01se-net-p-248.html  which says

"The final release of IE9 shows a huge performance decrease compared to the Platform Preview 7. If Microsoft is able to recover this performance in a subsequent release then this would significantly change the standing of IE 9 in relation to the other modern browsers."

I would like to know if there is any workaround to do so or any other solution for this issue. Your help would be really appreciated.

For reference, here is the code which makes IE9 browser stop responding,  (this code iterates over options of multi-select html control and then sort it and then again set this sorted array as options to same multi-select control.)

function sortSelect(select)
{

    var copyOption = new Array();
    for (var i=0;i<select.options.length;i++)                   // this is the loop which breaks IE9
        copyOption[i] = new Array(select[i].value,select[i].text);
    copyOption.sort(function(a,b) {
        if (a[1] == b[1]) { return 0; }
        else if (a[1] > b[1]) { return 1; }
        else { return -1; }
        });
    select.selectedIndex = -1;
    select.options.length = 0;

    for (var i=0;i<copyOption.length;i++)
    {
       select.options[i]= new Option(copyOption[i][1],copyOption[i][0]);
    }
}

If anyone has faced same issue and found some solution over it please do reply.

Thanks,

~Shital.


Viewing all articles
Browse latest Browse all 3527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>