jQuery UI .draggable()在IE中导致问题

时间:2011-06-07 18:19:24

标签: jquery jquery-ui internet-explorer-8 draggable

http://www.madeupuniverse.com/ls-app-test/ls-app.html

我已经在所有浏览器中测试了这个应用程序,IE是唯一一个给我带来问题的(当然)。我在IE 8中测试。调试器给我这个错误......'data(...)。options'是null或者不是对象--jquery-ui-1.8.13.custom.min.js,106行59 ...它也给了我这个错误......'_cursor'是null或者不是对象 - jquery-ui-1.8.13.custom.min.js,106行第99个字符。

这是jQuery UI的错误还是可以解决这个问题。我尝试了很多不同的东西,但没有任何效果。

我正在使用jQuery UI 1.8.13和jQuery 1.5.1。

2 个答案:

答案 0 :(得分:2)

IE会阻塞对象声明中的尾随逗号。

中有一个
.draggable({
    drag: function(event, ui){
    },   <--- this comma kills IE
});

声明,以及

之前的另一个声明

//END drop section of .droppable()

评论

答案 1 :(得分:0)

我有这个问题并修复了它。我的问题是:

function onDrop(event,ui) {
  var handle = $(ui.draggable);
  handle.remove();

  *blahh. blahh..*

  $.ajax( 

     *blah.. blah..*

     success: function (data) { *whatever....* });

}

问题是IE9对这个丢弃处理程序没有问题,但是IE8会崩溃。我在我的ajax调用的.remove()事件中更改了success并且它有效。我想你不能从ondrop事件中删除句柄,如果你没有ajax调用,你可以用remove()尝试使用计时器...