Response title
This is preview!




<script type="text/javascript"> $(document).ready(function() { $.getJSON("data.json", function(data) { $('#flowerTmpl').tmpl(data).appendTo("body"); $('ul').append($('#liTmpl').tmpl(data)).listview("refresh") }) }) </script>I deferred execution of this code until jQuery triggers the ready event, rather than waiting for the jQuery Mobile pageinit event. I want to load my JSON data only once, and the pageinit event is triggered too often to make it a sensible choice. When I obtain the data, I call the tmpl method to add the dynamically generated pages to the body element in the document.
$('ul').listview("refresh")© 2012 jQuery Foundation
Sponsored by
and others.
