Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This appears to be a bug in certain scenarios, specifically those that involve AJAX. This article runs through steps to reproduce but does not give any resolution:</p> <p><a href="http://blog.darkthread.net/post-2011-03-19-ie9-ol-bug.aspx" rel="nofollow">http://blog.darkthread.net/post-2011-03-19-ie9-ol-bug.aspx</a></p> <p>Note that the article is in Chinese; I translated it with Chrome.</p> <p>Here is a <strong>working</strong> fiddle that shows it is possible to dynamically update a list without issue:</p> <p><a href="http://jsfiddle.net/6tr9p/18/" rel="nofollow">http://jsfiddle.net/6tr9p/18/</a></p> <p>Unfortunately, this doesn't rectify the problem when there is a need to combine AJAX/IE9/Ordered Lists, which is probably the case if the OP is using SharePoint.</p> <p>After wasting several hours on this problem myself, I can confirm that (outside of SharePoint) this is definitely a problem on IE 9.0.8112 on Windows 7. It also appears to impact the CSS <code>counter-increment</code> methodology for implementing ordered lists as well (i.e. it doesn't work; list items are still all numbered with zero).</p> <p>I will update my answer if I find a better solution than "deal with it"/"remove AJAX".</p> <p>EDIT: Here is my "better answer". </p> <p><strong>This code has only received preliminary testing, and involves hooking into the AJAX client-side API. It may break in other versions of IE, or in other browsers. Use at your own risk.</strong></p> <p>That said, it fixes the behavior of ordered lists displaying all zeros in IE9 with both implicit and explicit start numbers defined (via the start attribute). Note that the start attribute is no longer deprecated in HTML 5.</p> <pre><code>function endRequest_OL_Fix(sender, args) { var ols = document.getElementsByTagName("ol"); for (var i = 0; i &lt; ols.length; i++) { var explicitStart = ols[i].start; if (explicitStart &gt; 0) { ols[i].start = -1; ols[i].start = explicitStart; } else { ols[i].start = 1; } } } Sys.WebForms.PageRequestManager.getInstance().add_endRequest(endRequest_OL_Fix); </code></pre> <p>Once a request completes (including an async request) all OL tags on the page are examined. If they have an explicitly defined <code>start</code> attribute, it will be preserved, reset, and reassigned. Otherwise, <code>start</code> will be explicitly assigned.</p> <p>This forces a redraw and--with the aforementioned caveats--fixes the problem.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload