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?
- $(document).bind("mobileinit", function(){
- // Home page
- $('#home.ui-page').live('pagecreate', function(event, ui) {
- getDimensions();
- });
- });
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.
- $('#dimensiontemplate').tmpl(dimensionlist).appendTo('#dimensionlist');
- $('#dimensionlist').page();
- $('#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...