jQuery.tmpl gives error when fiering with mobileinit

jQuery.tmpl gives error when fiering with mobileinit

I hooked a function to the pageshow event and my tmpl method gives an error. Any clues?

  1. $(document).bind("mobileinit", function(){
  2.     // Home page

  3.     $('#home.ui-page').live('pagecreate', function(event, ui) {

  4.         getDimensions();

  5.     });

  6. });
getDimensions is basicly a ajaxcall which puts stuff into the template but I get an error when I call the appendTo method.
Pages are automagically loaded with ajax in jQM.
  1.             $('#dimensiontemplate').tmpl(dimensionlist).appendTo('#dimensionlist');
  2.             $('#dimensionlist').page();
  3.             $('#select-list').selectmenu("refresh", true);

The error is: $("#dimensiontemplate").tmpl(dimensionlist).appendTo is not a function
.appenTo is a function, if I call the page without ajax if works fine. jQuery.tmpl is loaded...