How to disable the array auto sort in ie9
<p>I have a javascript array(ary) and I need to print out each element as a select option in that array.</p>

<p>I found before the code goes into the loop - for (var i in ary), the array ary has been auto sorted in IE9, but on other browers, this doesn't happen.
I don't want my array to be sorted in IE9, is there any way to disable the auto sort in IE9?</p>

<p>The ary array is an object-filled array which is converted from php array  to javascript array. I don't quite familar with javascript, but I tried to use for(var i=0;i

<p>in the for(in) loop, I print out each element by using document.write(i) and I can see that in ie9 and chrome, the result is sorted by in firefox, the result is not sorted(which is what I want). </p>

<p>Following is the code</p>

<pre><code>for (var i in ary) {
        selected = false;
        if (optional &amp;&amp; !blank &amp;&amp; (ary[i][valuef] == '')) {
            blank = true;
        }
        if (typeof(value) == 'object') {
            for (var j in value) {
                if (optional &amp;&amp; !blank &amp;&amp; (value[j] == '')) {
                    blank_selected = true;
                }
                if (ary[i][valuef] == value[j]) {
                    selected = true;
                    break;
                }
            }
        } else if (ary[i][valuef] == value) {
            selected = true;
        }
        if (selected) {
            output += '&lt;option value="' + ary[i][valuef] +'" selected="selected"&gt;' + ary[i][namef] + '&lt;/option&gt;';
        } else {
            output += '&lt;option value="' + ary[i][valuef] +'"&gt;' + ary[i][namef] + '&lt;/option&gt;';
        }
    }
    if (optional &amp;&amp; !blank) {
        if (blank_selected) {
            output = '&lt;option value="" selected&gt;&lt;/option&gt;' + output;
        } else {
            output = '&lt;option value=""&gt;&lt;/option&gt;' + output;
        }
    }
    return output;
}
</code></pre>
