i tried to load div content from a separate page into another page.
PAGE TO LOAD CONTENT INTO:
<script type="text/javascript">
var auto_refresh = setInterval(function() {
$('#incidentsTable').load('content/test.php #table');
}, 1000);
</script>
<div id="incidentsTable">
</div>
Page to load content from
<?php
// Connect to Database
$db = DB::getInstance();
?>
<div id="table">
<table class='table'>
<thead>
<th>Latitude</th>
<th>Longitude</th>
</thead>
</table>
</div>
I got some strange output. Without the php part at the beginning, the content is loaded perfectly fine into the other page. As soon as I include this php code to get the data later on to fill the table (this part of the code is excluded in the code snippet), nothing appears anymore on the screen at this section of the page where I load the content into.
Am I not allowed to use PHP functionality before the DIV tags? Or did I miss something out?