最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - jQuery bug? .appendTo() not working in IE7 - Stack Overflow

programmeradmin1浏览0评论

I am trying to create an option transfer plugin for jQuery.

I have the basic functionality working in opera, firefox, chrome & safari but IE7 is failing to co-operate.

The transfer functions in IE7 appear to operate very sporadically and inprehensibly.

I have created an example page to illustrate my problem.

Can anyone see where I am going wrong?

Thanks,

I am trying to create an option transfer plugin for jQuery.

I have the basic functionality working in opera, firefox, chrome & safari but IE7 is failing to co-operate.

The transfer functions in IE7 appear to operate very sporadically and inprehensibly.

I have created an example page to illustrate my problem.

Can anyone see where I am going wrong?

Thanks,

Share Improve this question edited Feb 4, 2010 at 16:11 Mike asked Feb 4, 2010 at 15:38 MikeMike 6,02811 gold badges34 silver badges45 bronze badges 3
  • No idea what the source of the problem is, but I did replicate. Odd. – Karmic Coder Commented Feb 4, 2010 at 15:45
  • More likely its a IE 7 bug... ;) – jamone Commented Feb 4, 2010 at 21:29
  • hehe, you say that... Swapping in different versions jQuery produces different "effects". :p – Mike Commented Feb 4, 2010 at 22:45
Add a ment  | 

2 Answers 2

Reset to default 6

This doesn't look like an .appendTo()-error-in-jQuery as much as an IE7-has-superfunky-select-box-behavior problem. This workaround seems to make it behave:

.parent()
 .click(function () {     
    $selectBox1.find('option:selected')
               .appendTo($selectBox2.find('select'));
    $selectBox1.html($selectBox1.html());
    $selectBox2.html($selectBox2.html());                               
    sortBox($selectBox2); 
   })

Rebuilding the html of each select box after the appendTo() forces IE to update its state.

JSbin: http://jsbin./opome3/4 (fixed with .clone(true) for first button.)

I'm getting an error in ie:

Line: 16 Error: 'undefined' is null or not an object

That points to this:

j=l.replace(/^[\-\d\.]+/,"")

I'm guessing you need to test for null? Just a guess.

发布评论

评论列表(0)

  1. 暂无评论