this is my code...
$(function() {
$(".Like").livequery("click", function(e)
{
var ldl_session_id = $("#session_id").val();
var name = $("#commentName").val();
var ldl_id = $(this).attr("id").replace("post_id","");
var parent = $("#display_like_names-"+ldl_id);
// var parent = $(this);
$(this).fadeOut(200);
$.ajax({
type: "POST",
url: "ajax_like_names.php",
data: "ldl_post_session_id="+ldl_session_id+"&ldl_post_id="+ldl_id,
cache: true,
success: function(html)
{
parent.html(html);
parent.fadeIn(200);
}
});
return false;
});
});
$(function() {
$(".Like").livequery("click", function(e)
{
var ldl_session_id = $("#session_id").val();
var name = $("#commentName").val();
var ldl_id = $(this).attr("id").replace("post_id","");
var parent = $(this);
$(this).fadeOut(200);
$.ajax({
type: "POST",
url: "ajax_like.php",
data: "ldl_post_session_id="+ldl_session_id+"&ldl_post_id="+ldl_id,
cache: true,
success: function(html)
{
// $("#display_like_names-"+ldl_id).load("posts.php #display_like_names-"+ldl_id);
parent.html(html);
parent.fadeIn(200);
}
});
return false;
});
});
it works fine with bringing in the content from url ajax_like.php but i need to click twice to bring in the content from ajax_like_names.php.
i dont understand why i need to click twice to get ajax_like_names to work, i looked in firebug and the varibles are being posted on the first click but its not bringing the html back untill the second click, please help :)