1.jsp/frame中代码
<c:when test="${fn:length(requestScope.infoList.results) > 0}">
<c:forEach items="${requestScope.infoList.results}" var="infoitem"
varStatus="index">
<tr class='appendTrData' bgcolor='#FFFFFF' height="30px" οnclick='showDetails(this)' ip='${infoitem.info[7]}' service_code='${infoitem.info[8]}' serviceName='${infoitem.info[0]}'>
2.jsp自定义标签
3.action直接返回jsp页面,用$("#div").html(data);插入div中
4.js阻止事件冒泡
//阻止冒泡事件
function stopBubble(e) {
//如果提供了事件对象,则这是一个非IE浏览器
if ( e && e.stopPropagation )
//因此它支持W3C的stopPropagation()方法
e.stopPropagation();
else
//否则,我们需要使用IE的方式来取消事件冒泡
window.event.cancelBubble = true;
}
5.var showDetails=function(obj){
window.parent.showDetails(obj);
}
iframe子页面调用 父页面js函数
子页面调用父页面函数只需要写上window.parent就可以了。比如调用a()函数,就写成:
window.parent.a();
iframe父页面调用 子页面js函数
这个就稍微复杂一些,下面的方法支持ie和firefox浏览器:
document.getElementById('ifrtest').contentWindow.b();
注:ifrtest是iframe框架的id,b()为子页面js函数。contentWindow属性是指定的frame或者iframe所在的window对象,IE下可以省略。