iPhone+jQuery strangeness, jQuery loses touch with the DOM?

iPhone+jQuery strangeness, jQuery loses touch with the DOM?


Hello,
I'm having a strange issue using jQuery on UIWebComponent on the
iPhone - at some point jQuery becomes unable to add content to the
DOM, while regular DOM methods (document.getElementById
('something').appendChild(x) ) continue to work.
I've posted details on stackoverflow, and I'll describe them below.
I'm hoping someone here can point me in the right direction:
http://stackoverflow.com/questions/591949/iphone-webkit-jquery-strangeness-cant-update-content
I'm doing funky things with UIWebComponent, passing control back and
forth between objective-C and WebKit: from WebKit I invoke Objective-C
code by calling a special URL that the Objective-C handler catches,
and from Objective-C I execute Javascript in WebKit. Works well for
the most part.
I switch "pages" by showing and hiding divs on the same html page.
After switching a couple of times and some objC-Webkit interactions,
jQuery becomes unable to update the dom.
var x = document.createTextNode('THE FIRST THING');
document.getElementById('thumbspage').appendChild(x);
$('#thumbspage').append('-- THE SECOND THING');
"THE FIRST THING" shows up, "THE SECOND THING" doesn't .
I can still hide and remove elements using jQuery, but I can't add
anything.
Any ideas?
Best,
Parand
http://parand.com/say/