Consider the following very simple code excerpt:
(...)
<div id="myDiv"></div>
<script>
function appendSomeJQueryMobileStuff() {
$('#myDiv').append($('<select/>'));
}
appendSomeJQueryMobileStuff();
$(document).on('pageinit', function() {
appendSomeJQueryMobileStuff();
});
</script>
(try it out @ https://jsfiddle.net/ca544oob/)
Why is only the first <select>
displayed with jQuery, but the second one isn't formatted at all? The only difference between the two function calls that I see is the moment when it happens.
And how do I fix this?