Welcome Guest, Not a member yet? Register   Sign In
Auto refresh particular div using jquery or AJAX
#1

[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">
        &lt;? $this->load->view('jobs_page.php'); ?&gt;
</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>
                    &lt;?
                        $result = $jobs;
                        foreach($result as $row)
                        {    
                    ?&gt;
                    <tr>
                        <td>&lt;? echo $row->id; ?&gt;</td>
                        <td>&lt;? echo $row->prj_name; ?&gt;</td>
                        <td>&lt;? echo $row->status; ?&gt;</td>
                        <td>&lt;? echo $row->progress; ?&gt;</td>
                        <td>&lt;? echo $row->prj_percent; ?&gt;</td>
                        <td>&lt;? echo $row->deadline; ?&gt;</td>
                        <td>&lt;input type="text" id="tester"&gt;&lt;/td>
                    </tr>
                    &lt;?  } ?&gt;
</table>

any help regarding this is highly appreciated. Thank you before.


Messages In This Thread
Auto refresh particular div using jquery or AJAX - by El Forum - 07-26-2012, 08:44 PM
Auto refresh particular div using jquery or AJAX - by El Forum - 07-27-2012, 12:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB