Weird iOS bug for html() first time only?

Weird iOS bug for html() first time only?

Hi,

I am currently working on an iOS app using phonegap to build. My pages are loaded via AJAX into a #wrapper_block div, which is where I hold the contents.

I have the following code in my function, which seems to break in iOS 5 (not sure about iOS6);

  1.         alert("test 5?");
  2.         $('#wrapper_block').html(new_data); // this breaks
  3.         alert("test 6?");

"test 6" doesn't show up, but when you press the same link again - it works perfectly! (and gets there fine)

If I change the html() part to use the standard JS innerHTML, it works perfecetly:

  1.         document.getElementById('wrapper_block').innerHTML=new_data;

Is there any known bugs around this?

The weird thing is that it works fine in Safari, Chrome, IE, Firefox and Android... just not iOS!

TIA

Andy