• Shadow666
  • 0 Points
  • Member since 2011

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 1

So clearly IE9 is causing some major headaches with Visualforce. Rerenders completely broke with IE9 but forcing the browser to run in compatibilty mode is a decent short term fix: http://boards.developerforce.com/t5/Visualforce-Development/Ajax-doesn-t-work-in-IE9/td-p/259049 . This works great.... unless the page is being served from an iframe. If it is the hack won't work and the page breaks anytime a rerender is performed. This means inline VF pages still don't have a work around and any pages you may have in other iframes won't work with IE9.


This is a serious problem for us as we have several webforms integrated into other sites with iframes.


Here is some code and pages to reproduce. This page has the IE9 hack fix and works okay.





<apex:page controller="IERerenderBug" showHeader="false" standardStylesheets="false">
    <apex:form >
        <apex:commandButton value="Go" action="{!doSomething}" reRender="output" status="status"/>
        <apex:actionStatus id="status">
            <apex:facet name="start">
                Doing something...
        <apex:outputPanel id="output">



public class IERerenderBug {

    public IERerenderBug(){
        //IE9 Visualforce hack
        String browserType = Apexpages.currentPage().getHeaders().get('USER-AGENT'); //gets the browser name 
        if(browserType != null && browserType.contains('MSIE')){
            Apexpages.currentPage().getHeaders().put('X-UA-Compatible', 'IE=8');
    public void doSomething() {

    public Integer getTime(){
        return system.now().second();

The above works fine but if that page is in an iframe somewhere else the hack does not work:



<apex:page showHeader="false">
    This is an iframe of IEBug page... hack doesn't work if page is in an iframe.
    <iframe width="100%" height="200" frameborder="1" src="{!$Page.IEBug}"></iframe>


Does anyone know of any tricks or hacks to get this working when the page is in an iframe?




  • March 23, 2011
  • Like
  • 0