[eluser]newbie boy[/eluser]
i've done a select function in ajax, where if a user select on a certain username, it will display a certain info about him.
i used firebug console and it actually run perfectly by getting the right data for the post but my problem is there in no reponse or no display at all.
here's my code:
Code:
$("select#user").change(function(){
var id = $(this).val();
$.ajax({
url: '../index.php/UserController/getUserInfo',
data: 'id=' + id,
type: 'POST',
dataType: "json",
success: function (data){
if (data != null) {
$.each(data, function() {
$("p#id").append(id);
})
}
else
if (data == null) {
}
},
error: function(xhr, err, e){
alert("Error: " + err);
}
}); // $.ajax()
});
thanks guys.