JavaScript IE appendChild() - Unexpected call to method or property access

后端 未结 7 876
旧巷少年郎
旧巷少年郎 2021-01-13 08:55

I have been having this problem in IE. I have two divs which I use to drag selected elements from one to another. Lets say I have a child element (also a div) in div1 and so

7条回答
  •  萌比男神i
    2021-01-13 09:09

    just had the same problem with IE7, cured it by adding a timeout:

    setTimeout(function(){gallery.appendChild(g_field)},300);
    

    I've lost count of the no of times something doesn't work in IE but works perfectly in Firefox that can be solved by a short delay...no idea why!

    Sorry! spoke to soon...turns out my timeout (in this case) didn't work.

提交回复
热议问题