简体   繁体   中英

Jquery sortable errors in IE

Getting some rather unusual errors when sorting in IE 7 and 8 (works fine in 9).

http://jsfiddle.net/pC5qg/

Jquery:

$(".first, .second, .third").sortable({
    update : function (event, ui) {

        var listItem = $(this).sortable('toArray');
        var string = "navOrder=1&listItem=" + listItem;

    }
});   

HTML:

<ul class="first">
  <li id="4">Learn More About The Law
    <ul class="second">
      <li id="49">ACA Overview</li>
      <li id="45">Timelines
        <ul class="third">
          <li id="31">Already in Effect</li>
          <li id="55">2012 Timeline</li>
          <li id="56">2013 Timeline</li>
          <li id="57">2014 Timeline</li>
          <li id="58">2015 and on</li>
        </ul>
      </li>
    </ul>
  </li>
  <li id="2">How Will Reform Affect Me?
    <ul class="second">
      <li id="32">I Have a Pre-existing Condition</li>
      <li id="47">I Have Medicare
        <ul class="third">
          <li id="54">Medicare Insert</li>
          <li id="20">Overview of Medicare Changes</li>
          <li id="21">Medicare Advantage Plans</li>
          <li id="22">Medicare Part D</li>
        </ul>
      </li>
      <li id="50">I Have Insurance
        <ul class="third">
          <li id="51">I Have Insurance From My Employer</li>
          <li id="52">I Buy My Own Insurance</li>
        </ul>
      </li>
      <li id="48">Small Businesses
        <ul class="third">
          <li id="42">Small Business Tax Credits</li>
          <li id="28">Grants for Small Business Wellness Programs</li>
          <li id="27">Free Choice Voucher</li>
        </ul>
      </li>
      <li id="53">Large Businesses
        <ul class="third">
          <li id="38">Large Employer Insurance Requirement</li>
          <li id="39"> Am I a Large Employer?</li>
          <li id="44">Large Employer Fines</li>
        </ul>
      </li>
    </ul>
  </li>
  <li id="3">Is What I Hear True?
    <ul class="second">
      <li id="59">Why should I care about healthcare reform?</li>
      <li id="40">Will the government have a say in my end-of-life decisions?</li>
      <li id="41">Will Medicare services be cut to control costs?</li>
      <li id="43">Will public funds be used to pay for abortions?</li>
    </ul>
  </li>
  <li id="5">Resources
    <ul class="second">
      <li id="33">External Resources</li>
    </ul>
  </li>
</ul>

通过升级到Jquery 1.5.2和UI 1.8.13,此问题已解决。

I think the exception is actually in jsfiddle, not in sortable : breaking into a debugger and tracing the call stack indicates there is an error in http://jsfiddle.net/codemirror/js/editor.js in the scheduleHighlight method (line 1369 according to Visual Studio). Following the trace the actual crash is in http://jsfiddle.net/codemirror/js/select.js on line 167: in certain IE versions attempts to select a range cause a crash.

Does the error occur outside jsfiddle?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM