问题
I am using JSF 1,2 and I found that IE9 or higher doesn't support Ajax scripts and requests. In my project I have the same problems and errors as u can reproduce on: this source using IE 9+
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:a4j="http://richfaces.org/a4j"
xmlns:rich="http://richfaces.org/rich">
<h:form>
<rich:panel bodyClass="rich-laguna-panel-no-header">
<a4j:commandButton value="Set Name to Alex" reRender="rep" >
<a4j:actionparam name="username" value="Alex" assignTo="#{userBean.name}"/>
</a4j:commandButton>
<rich:spacer width="20" />
<a4j:commandButton value="Set Name to John" reRender="rep" >
<a4j:actionparam name="username" value="John" assignTo="#{userBean.name}"/>
</a4j:commandButton>
</rich:panel>
<rich:spacer height="1" />
<rich:panel bodyClass="rich-laguna-panel-no-header">
<h:outputText id="rep" value="Selected Name:#{userBean.name}"/>
</rich:panel>
</h:form>
Has someone ever faced with this problem and found any solution?
The problem should be fixed on server and not on user environment.
Thank you.
回答1:
RichFaces 3.x does not support IE9. Refer to this answer for more details.
Possible solutions (as stated in the referenced answer):
- Upgrade to RichFaces 4.
- Turn on or force IE8 compatibility mode
- Patch RichFaces 3 (mostly javascripts) to make it work with IE9 in native mode (refer to the JBoss forum topic from the referenced answer for more details).
回答2:
It works in IE 9+ with IE8 compatibility mode. Add meta tag <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" />
and try it.
来源:https://stackoverflow.com/questions/20799156/ajax-scripts-dont-work-in-ie