First do not use $(function() or $(document).ready() with jQuery Mobile, simply because jQM is not built to work like that. Instead you should use page events mentioned here: https://stackoverflow.com/a/14010308/1848600 or mobileinit event like this:
$(document).on("pageinit", function () {
});
or mobileinit if you want it to be executed only once at app execution:
$(document).on("mobileinit", function () {
});
Reason is described in top link. Also you can find more about this in jQM official documentation: http://jquerymobile.com/test/docs/api/events.html
Now if you want jQM to restyle your page you should use .trigger('pagecreate') function.
Let's say, for example you have a jQM page with id index and this is your generated layout.
<div data-role="page" id="index">
<div data-theme="a" data-role="header">
<h3>
First Page
</h3>
<a href="#second" class="ui-btn-right">Next</a>
</div>
<div data-role="content">
<a href="#" data-role="button" id="test-button">Test button</a>
</div>
<div data-theme="a" data-role="footer" data-position="fixed">
</div>
</div>
To force jQM to style it you should use something like this:
$('#index').live('pagebeforeshow',function(e,data){
$('#index').trigger('pagecreate');
});
or if you want to apply it to every jQM page, use it like this:
$('[data-role="page"]').live('pagebeforeshow',function(e,data){
$(this).trigger('pagecreate');
});