topicDetails.jsp:
<div class="right_theme" id="rightTheme"> </div>
<jsp:include page='/common/page.jsp'/>
$("#rightTheme").load(url); document.getElementById("rightTheme").url=url;
topic_knowledge.jsp: javascript
<script type="text/javascript" src="<c:out value="${ctx}"/>/js/jquery-1.4.min.js"></script> <script type="text/javascript" src="<c:out value="${ctx}"/>/js/commonKE.js"></script> <script type="text/javascript"> ajaxAnywhere.getZonesToReload = function() { return "zoneName"; } </script> <aa:zone name="zoneName"> <form action="<c:out value="${ctx}"/>/topic.do?method=showKnowByNowTopic" method="post" id="mainform" name="mainform"> <input type="hidden" id="topicId" name="topicId" value="${topicId}"/> ...... </form>
<!--搜索 --> function searchByName(){ var f = document.forms[0]; var searchName = document.getElementById("searchNamehi").value; document.getElementById("searchName").value=searchName; ajaxAnywhere.formName = "mainform"; ajaxAnywhere.submitAJAX(); // f.action="<c:out value="${ctx}"/>/myContributeController.do?method=departementKnowledgePageRight&searchName="+searchName; // f.submit(); }
<%@ include file="/common/common.jsp"%>:
<%= "<!-- "+request.getRequestURI()+" -->" %> <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> <c:set var="ctx" value="${pageContext.request.contextPath}"/> <%@ taglib uri="http://ajaxanywhere.sourceforge.net/" prefix="aa" %> <link rel="stylesheet" href="<c:out value="${ctx}"/>/css/common.css" type="text/css" /> <script language="javascript" src="<c:out value="${ctx}"/>/erm-commons/scripts/aa.js" type="text/JavaScript"></script> <script> /** * Default sample loading message show function. Overrride it if you like. */ AjaxAnywhere.prototype.showLoadingMessage = function() { var div = document.getElementById("AA_" + this.id + "_loading_div"); if (div == null) { div = document.createElement("DIV"); document.body.appendChild(div); div.id = "AA_" + this.id + "_loading_div"; div.className = "aa-mask"; div.innerHTML = "<div></div>"; } div.style.display = ""; } </script> <style> .aa-mask { z-index: 100000; position: absolute; top:0; left:0; font-style:normal; -moz-opacity: 80; opacity: 80; filter: alpha(opacity=60,finishopacity=2); width: 100%; height: 100%; background-color:#ffffff; zoom: 1; text-align: center; } .aa-mask div{ position: absolute; width: 150px; height: 150px; background-image:url("<c:out value="${ctx}"/>/erm-commons/theme/2010/images/loading.gif"); top:40%; } </style>
另: css
需加的部分( java
) jquery
實現局部刷新:刷新父頁面的某一個iframe;(div的ID="modelload") ajax
window.parent.$("#modelload").load(url); app