0
我正在在我的网页下面的调用:从控制器返回部分视图时重新加载jQuery?
<div id="comments">
<fieldset>
<h4>
Post your comment</h4>
<% using (this.Ajax.BeginForm("CreateStoryComment", "Story", new { id = story.StoryId }, new AjaxOptions { UpdateTargetId = "comments", OnSuccess = "OnStoryCommentAdded" }))
{ %>
<%= this.Html.TextArea("Body", string.Empty)%>
<input type="submit" value="Add Comment" />
<% } %>
</fieldset>
</div>
还有其他的代码,但是这是它的要点。控制器返回一个局部视图,在评论div中“刷新”每一个。
我的问题是,没有应用以下的jQuery:
$(".comment .delete").click(function() {
if (confirm("Are you sure you want to delete this record?") == true) {
$.post(this.href);
$(this).parents(".comment").fadeOut("normal");
}
return false;
});
我假设它没有被连接,因为jQuery的负载inital页面加载后。如果我的假设是正确的,我如何获得这个jQuery来“刷新”。
希望这是有道理的! :)
完美的工作!谢谢! – mattruma 2010-06-07 01:02:57