我认为:
<div class="grid_12">
<div class="box tabbed news" id="box1">
<div class="header">
<h3>
<%: Model.News.Title %>
</h3>
</div>
<div class="content" id="newsItem">
<% Html.RenderPartial("NewsItem", Model); %>
</div>
<div class="clear"></div>
</div>
</div> <!-- End of .grid_12 -->
<div class="clear"></div>
<table id="table2">
</table>
<div class="grid_12">
<div class="box tabbed news" id="box2">
<div class="content" id="testdiv">
<table id="table">
<tr>
<td>
<a href="javascript:ShowReplyTextArea();" class="button">Reply</a>
</td>
<td>
<a href="javascript:ReplyPost(<%: Model.News.NewsId %>);" class="button" id="post_button">Post</a>
</td>
</tr>
</table>
</div>
</div>
</div>
<div class="clear"></div>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="ScriptPlaceHolder" runat="server">
<script type="text/javascript">
function ShowReplyTextArea() {
div = document.getElementById('testdiv')
textArea = document.createElement("textarea");
textArea.setAttribute('rows', 20);
textArea.setAttribute('cols', 149);
textArea.setAttribute('id', "textarea");
div.appendChild(textArea);
}
function ReplyPost(newsId) {
var message = $("#textarea").text();
if (message != null)
$("#post_button").show();
var jqxhr = $.getJSON("<%= Url.Action("ReplyPost", "Home", new { area = "News" }) %>?newsId=" + newsId + "&message=" + message, function (data) {
});
divtext = document.getElementById('table2');
divtext.setAttribute('text', message);
}
</script>
当我点击回复按钮时,我的文本区域会弹出,我输入了一些新闻,然后点击发布按钮。我需要显示我刚刚在 grid_12 div 下键入的内容。然后必须再次隐藏文本区域,直到我再次单击回复
我正在努力完成这项工作。有人可以帮忙吗?