In my php page, I’ve three lists ul#line, ul#comment, ul#vote.
I’m going to make an ajax call, something like
$.ajax({
type: "POST",
url: "ajax.php",
data: dataString,
cache: false,
success: function(html){
$("ul#line").append(html);
$("ul#lineli:last").fadeIn("slow");
}
Ajax.php is something like
if(isset($line)){
echo $line;
} elseif(isset($comment)){
echo $comment;
} elseif (isset($vote)){
echo $vote;
} else {
//do nothing;
}
What I want is, if the echoed out HTML is $line, it’ll be appended to ul#line; if it is $comment, it’ll be appended to ul#comment; if it is $vote, it’ll be appended to ul#vote.
The current ajax call appends only at ul#line.
What do I need to change to achieve this??
php
javascript