struts2瓦片javascript加载
我在我的演示项目strut2 tiles插件中使用,我的tiles看起来像struts2瓦片javascript加载,javascript,jquery,struts2,tiles,Javascript,Jquery,Struts2,Tiles,我在我的演示项目strut2 tiles插件中使用,我的tiles看起来像 <definition name="profileListPanel" extends="basePanel"> <put-attribute name="title" value="menu.adm.pro.title"></put-attribute> <put-list-attribute name="body-items"> <add-attribute va
<definition name="profileListPanel" extends="basePanel">
<put-attribute name="title" value="menu.adm.pro.title"></put-attribute>
<put-list-attribute name="body-items">
<add-attribute value="/jsp/admin/profile/profileList.jsp"/>
</put-list-attribute>
</definition>
<definition name="profileList" extends="baseLayout">
<put-attribute name="title" value="menu.adm.pro.title" />
<put-list-attribute name="body-items">
<add-attribute value="profileListPanel" type="definition"></add-attribute>
</put-list-attribute>
</definition>
问题是:
profileList.js被多次加载
和$('.edit profile')
附加了多个事件
一些想法?你在哪里加载
profileList.js
?在profileList.jsp中我有这个脚本我认为问题可能是在我交互时,删除迭代,问题也会持续存在
<tiles:importAttribute name="body-items" toName="bodyItems"/>
<s:iterator var="item" value="%{#attr.bodyItems}">
<tiles:insertAttribute value="${item}" flush="false"></tiles:insertAttribute>
</s:iterator>
var editPopUp;
$(document).ready(function(){
editPopUp=new PopUp();
$('.edit-profile').click(function(e) {
e.preventDefault();
var url=$(this).attr('href');
editPopUp.openPopUp(url);
});
});