
Untitled
By: a guest on
Aug 1st, 2012 | syntax:
None | size: 0.88 KB | hits: 7 | expires: Never
Response from .ajax method is replacing previous contents always when btton is clicked
<table border="0" class="commentbox">
<tr>
<td>Some Item text
</td>
</tr>
<tr>
<td>
<div id="<%:containerid %>"></div>
<input type="button" class='btnReply' id="<%:rid %>" value="Reply"/>
</td>
</tr>
<tr>
<td>
<div id="replytopost">
</div>
</td>
</tr>
</table>
$(document).ready(function () {
$(".commentbox .btnSave").live("click", function () {
alert("hii");
var itemId = $(this).attr("id").split("-")[1]
var txt = $(this).parent().find(".txtCmnt").val();
alert(itemId + txt);
$.post("Handler/Topic.ashx", { reply: txt, id: itemId }, function (data) {
alert(data);
$("#replytopost").html(data);
//do whatever with the response
})
});
});