Reputation: 4564
I have a div displayed in the manner you see on the code and I need it to be refreshed everytime someone click on one of the links:
$str.= "<div id='foldersdiv'>";
foreach ($folderslist as &$value) {
$str.= " <a href=\"#1\" onClick=\"change_status_sp('{$spDetails->sp_id}','".$valu."');\">".$value['items']."</a>";
}
} // loop ends
$str.= "</div>";
Upvotes: 0
Views: 478
Reputation: 1231
Very basic example. This will get you started. But I'd look into the .ajax function. It has heaps of options.
function change_status_sp(id)
{
$('#foldersdiv').load('ajax/list.php?id='+id, function() {
alert('Load was performed.');
});
}
Upvotes: 1