0
<script>
function ShowCommentBox() {
$("#dialog").dialog({ modal: true });
}
function GrabDetails() {
var obj = jQuery.parseJSON('{"name":"John"}');
$("#item").val(obj.name);
}
</script>
<div id="dialog" title="Comments" style="display:none;">
<table class="detailstable FadeOutOnEdit">
<tr>
<th>Item</th>
</tr>
<tr>
<td><asp:Label ID="ItemIdLabel" Text="item" runat="server"/></td>
</tr>
</table>
</div>
<input id="SubmitCommentsToInvoice" type="button" value="Comments" onclick="ShowCommentBox()" />
在我的asp.net項目中,當用戶單擊'註釋'按鈕時,div顯示包含標籤。 我試圖用JSON來顯示字符串「約翰」 - 存儲在他們#item對象在'GrabDetails()'存儲字符串並使用JSON抓取
然後在標籤text =「」我如何拉存儲的值#item對象。
由於
'$( 「#項目」)...'暗示有一個帶有id =「item」的html元素 - 我沒有看到它顯示的html。 – Igor 2013-03-15 14:23:05