[eluser]Unknown[/eluser]
Hi everyone,
i'm a beginner in using the codeigniter and i have a question on how to refresh particular div using jquery or ajax. i've tried to search and try to fix it but it is not working.
this is my view page:
home_page.php
Code:
function test(){
$('#jobs').html("<?php $this->load->view('jobs_page.php'); ?>");
}
setInterval( "test()", 1000 );
this is the div that needs to be auto updated
Code:
<div id="jobs" class="middle_row">
<? $this->load->view('jobs_page.php'); ?>
</div>
this is the jobs_page.php
Code:
<table border="1" width="100%" bgcolor="transparent">
<tr>
<td width="10px">No.</td>
<td>Description</td>
<td>Status</td>
<td>Progress</td>
<td width="70px">Project %</td>
<td>Deadline</td>
<td>Action</td>
</tr>
<?
$result = $jobs;
foreach($result as $row)
{
?>
<tr>
<td><? echo $row->id; ?></td>
<td><? echo $row->prj_name; ?></td>
<td><? echo $row->status; ?></td>
<td><? echo $row->progress; ?></td>
<td><? echo $row->prj_percent; ?></td>
<td><? echo $row->deadline; ?></td>
<td><input type="text" id="tester"></td>
</tr>
<? } ?>
</table>
any help regarding this is highly appreciated. Thank you before.