[eluser]stevefink[/eluser]
Hi all,
I have a simple javascript file being loaded externally that has the following code:
-- snip --
$(document).ready(function() {
$('#pendingUsers').load('index.php/meduser/check_pending_users',false, function() {
$('#pendingUsers a').click(function() {
$.post('index.php/meduser/pull_user_information', {id: $(this).attr('rel')}
);
});
});
setInterval(function() {
$('#pendingUsers').load('index.php/meduser/check_pending_users');
}, 300000);
// initially hide the main content div until a pending user is clicked.
});
-- snip --
My issue here is I'm not sure how with CI to associate the $.post() with the div I want to populate the data back from the server with in a view. My view contains a <div id="main"></div> area where the results should be posted back.
My controller looks like this:
function pull_user_information()
{
$id = $this->input->post('id');
$data['query'] = $this->db_users->query('select * from tbl_signups
where ID="$id"'
);
$this->load->view('default/meduser_useraccordny_view', $data);
}
I'm trying to populate the rel of the anchor tag into $id and using that to query the database.
I can then pass that into the meduser_useraccordny_view, however I'm still not entirely sure how to populate the particular div.
Any assistance would be appreciated!