I have the following script :
<script>
$(document).ready(function(){
setInterval(function() {
$.ajax({
type: "GET",
url: "<?php echo base_url(); ?>profile/load_data",
dataType: "JSON",
success: function(people) {
waiting_list=$('#waiting_list').empty();
$.each(people, function(i, waiting){
waiting_list.append('<a href="profile/details">'+waiting.id+" "+waiting.lname+" "+waiting.sname+'</a>');
});
},
error: function(data) {
// alert('An error occured, kindly try later');
}
});
}, 10000);
});
</script>
I want to create a dynamic url by adding a variable (id) at the end of the link to be href="profile/details/id . How can I do this?