0
我們有一個在struts-2.0.14
中開發的正在運行的應用程序。在此我們使用Ajax主題來顯示內容。
這個ajax主題運行在除IE9瀏覽器以外的所有瀏覽器中,在IE9中這個ajax主題製作問題。結果顯示在新選項卡中,而不是顯示在由targets
屬性指定的目標元素(div)中。IE9中的Struts2 ajax主題問題
父頁
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<s:head theme="ajax" debug="false" />
</head>
<body>
<s:url id="changePwd" action="changePassword" />
<s:div theme="ajax" id="pwdDiv" executeScripts="true" href="%{changePwd}" loadingText="Loading..."/>
</body>
</html>
內頁
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<s:form action="changePassword" id="resetPassword" name="resetPassword">
<s:textfield name="username" id="username" />
<s:password showPassword="true" name="newpassword" id="newpassword" value="%{newpassword}"/>
<s:password showPassword="true" name="confirmpassword" id="confirmpassword" value="%{confirmpassword}"/>
<s:submit value="Confirm" showLoadingText="false" onclick="clearMsg();" theme="ajax" targets="pwdDiv" executeScripts="true" cssClass="userbutton" />
</s:form>
當1.5.2內頁的形式生成的頁面彈出到新標籤。實際上它應該取代pwdDiv
的內容。 注:同正常在其他瀏覽器包括(IE7,8)工作
更新: 使showLoadingText作爲真正發出請求作爲阿賈克斯,但值爲零(密碼傳遞,確認密碼ECT ,. - 所有字段)
** Ajax主題/ Ajax標記**已被棄用,並且自Struts-2.1 +以來由** Dojo插件**取代。但** Dojo插件**也被棄用。 「棄用Ajax主題」意味着您的問題在新版本的Struts2中永遠不會解決。你爲什麼不更新Struts2到更新的版本,並嘗試'棄用的'** Dojo插件**或使用第三方** [Struts2 jQuery插件](http://code.google.com/p/struts2-jquery /)** – lschin 2011-06-17 08:46:00
該項目已經在線,所以我們無法更新struts版本。遷移需要大量的資源和時間。我需要修復ie9的代碼 – gnanz 2011-06-17 08:56:47
在Firefox等其他瀏覽器中怎麼樣?或用Firebug在Firefox中查看該頁面。 – lschin 2011-06-17 09:07:20