0
私はajaxフォームでstruts2を使用していますが、リンクの最初のリンクでのみ動作します。ページ内の私はjQuery ajaxの動的IDコールajaxの支援が必要です
コードページのjsp
<s:iterator value="listlog" status="incr">
<tr>
<td class="data"><s:property value="xxxx"/></td>
.............................................
<td class="data"><s:property value="status"/></td>
<td class="data">
<button id="popModal_ex1" class="btn btn-primary" data-popmodal-bind="#content_blob" ><a class="get_content_blob" id=<s:property value='id'/> >Content</a></button>
<div style="display:none" ><div id="content_blob"></div></div>
</td>
</tr>
</s:iterator>
コードアヤックス
<script language='javascript'>
$(document).ready(function() {
$('#popModal_ex1 a').click(function() {
var idaaa = null;
idaaa = $(".get_content_blob").attr('id');
$.ajax({
url: "/Struts_2/page/msg_detail.action?id=" + idaaa,
type: 'GET',
data: "",
cache: false,
timeout: 55000,
success: function (data)
{
$("#content_blob").html(data).fadeIn();
return;
}
});
});
});
</script>
ハグ誰もが懸念感じ、あなただけしたいので、代わりにアンカータグを使用しての
ここで何が悪かったのか?何が必要なの? – Saranjith
同じ要素に対してIDの代わりにクラスを使用する –
'
'に一意のIDが必要な場合は、fadeInで参照することができます –