Skip to: Site menu | Main content

I know stuff!

In web development and programming, I often come across useful tidbits that solve a problem for me. I often have those problems again and can't remember that tidbit. Now I will. Maybe you can benefit too.

jQuery wrap(html) not working - appendChild bug
Published: 3/31/2009 by mr.dossett

Today I ran into a problem where jQuery's wrap function wasn't working. It took me a while to figure out there even was a problem as it turns out it's browser specific. One guess, which browser had the problem. IE 7. I'd already upgraded to IE 8 which apparently fixed the appendChild bug.

At first in IE I only got a generic line blah error.  But with the help of a co-worker who still had IE 7 installed, we were able to determine that the error was happening when jQuery was trying to append my wrapped content using .appendChild.   Then came the requisite Google search which led me to the IE 7 appendChild bug.

This apparently only happens when you try and use appendChild on an object inside a table, which was the case for what I was trying to wrap.   In my case I was able to work around it by doing the wrapping manually.  So good for IE 8 for fixing the bug, now let's just hope people upgrade.

Relevant Tags: AJAX | Browsers | JavaScript

Comments:

No Comments Available - You can be first!

Add a Comment:








(Note: I reserve the right to remove any comments I deem not worthy.)