我正在使用Struts2 JQuery锚标记(sj:a)在同一页面上显示动作类的内容,但是单击链接后没有任何反应。
<table>
<tr>
<th>Thesis ID</th>
<th>Thesis title</th>
<th>Student Name</th>
<th>Submitted date</th>
</tr>
<s:iterator value="acceptedThesis" var="thesis">
<tr>
<s:url action="displayThesisDetails" var="displayThesisDetails_url">
<s:param name="id" value="#thesis" />
</s:url>
<s:iterator value="#thesis" var="thesis_element" begin="0" end="3">
<td><sj:a href="%{displayThesisDetails_url}" targets="div1"><s:property value="#thesis_element" /></sj:a></td>
</s:iterator>
</tr>
</s:iterator>
</table>
<div id="div1">Div 1</div>
我正在获取要在表中打印的对象论文列表,并已将每一行都链接为链接,单击链接时,我希望链接的内容显示在我指定ID为div1的div的位置
当我尝试使用普通锚标记显示内容时,它可以正常工作并在新页面上显示内容,但我想在同一页面上显示。
这是为每一行生成的JQuery。
<td><a id="anchor_1037311689" href="javascript:void(0)">12</a>
<script type='text/javascript'>
jQuery(document).ready(function () {
var options_anchor_1037311689 = {};
options_anchor_1037311689.jqueryaction = "anchor";
options_anchor_1037311689.id = "anchor_1037311689";
options_anchor_1037311689.targets = "div1";
options_anchor_1037311689.href = "/LoginApp/displayThesisDetails.action";
options_anchor_1037311689.hrefparameter = "id=12&id=thesis&id=user&id=2019-03-14&id=1&id=r1&id=2019-03-08";
jQuery.struts2_jquery.bind(jQuery('#anchor_1037311689'),options_anchor_1037311689);
});
</script></td>