Ajax scripts don't work in IE

你说的曾经没有我的故事 提交于 2019-12-11 05:59:11

问题


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):

  1. Upgrade to RichFaces 4.
  2. Turn on or force IE8 compatibility mode
  3. 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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!