[eluser]winterain[/eluser]
As of yesterday, I was using prototype.. as of today, I've switched to jquery completely because it is much simpler to use and noob-friendly. haha.. My problem persists though, this is how I'm handling the ajax..
Code:
var params = $("form#form_comment").serialize();
$.ajax({
type: "POST",
url: base_url+"/music/sendcomment",
data: params,
success: function(a){
$("form#form_comment")[0].reset();
$("#comm_f_status").hide();
$("#comm_f_status").html(a);
$("#comm_f_status").fadeIn('slow');
}
});
i figured as long as I can sneak a variable out from Controller and reference it here, I can just add an if statement. Thing is my Controller is echoing the success/failure message.
if I return an object, how can I use it in jquery ?
ie:
Controller:
Code:
$data['msg'] = 'successful!!!';
$data['success'] = TRUE;
back in jquery, it will get that object as ' a ' but how do i get the values inside ?