I am making an HTML5 app, and I am loading data from a database into the HTML by using the .load() function of jQuery. The function work great, but the problem is that the HTML code loaded is it not modified by the style sheet (jQuery Mobile). The reason that I am doing this is because I would be using PhoneGap Build to get an android app.
Here is my code break into pieces:
HEAD:
<head>
<title>Parking Lot App</title>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.1/jquery.mobile.structure-1.3.1.min.css" />
<link rel="stylesheet" href="themes/florida_tech.min.css" />
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.1/jquery.mobile-1.3.1.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$( "#maps" ).get( "map_list.php");
window.setTimeout(function(){ document.location.reload(true); }, 10000);
});
</script>
</head>
BODY:
<body>
<!-- HOME PAGE -->
<div data-role="page" id="home_page" class="name" data-theme="a">
<!-- HEADER HOME PAGE -->
<div data-role='header' id='header'>
<h2>
Parking Lot App
</h2>
<a href='index.html' data-iconpos='notext' data-icon='home'></a>
</div>
<!-- CONTENT HOME PAGE -->
<div data-role="content" data-theme="a" id="maps">
</div>
<!-- FOOTER HOME PAGE -->
<div data-role="footer" data-position="fixed">
<h3> Senior Design Project </h3>
</div>
</div> <!-- END OF HOME PAGE -->
</body>
And finally the file (after loading) that I am having trouble with, MAP_LIST.PHP:
<ul data-role="listview" data-inset="true" data-divider-theme="a" data-count-theme="b">
<li data-role="list-divider"> Parking Lots </li>
<li>
<a href="#mapdata1"
data-inline="true"
> Parking Lot 1
<span class="ui-li-count">0</span></a></li><li><a href='#info'> Help </a></li>
</ul>
I was wondering if there is another/better way to paste the data from the database into my HTML code so that the styling would modify the code.