• #36933
    Salesforce | Aman Aman
    Forcetalks

    How to achieve the below given command line using Salesforce Apex?

    It may happen that below tips will not work as lots of time the page header already sent. then how to achieve same result using Apex?

    <meta http-equiv=”X-UA-Compatible” content=”IE=EmulateIE8″ />

     

    • This topic was modified 4 months ago by Salesforce | Aman Aman.
    • This topic was modified 2 weeks ago by Salesforce | Team Team.
    • This topic was modified 2 weeks ago by Salesforce | Team Team.
    • This topic was modified 2 weeks ago by Salesforce | Team Team.
    • This topic was modified 2 weeks ago by Salesforce | Team Team.
    #36935
    Salesforce | shariq shariq #1
    Forcetalks

    Add below line of code in Apex (Constructor)

    Apexpages.currentPage().getHeaders().put(‘X-UA-Compatible’, ‘IE=8’);

    • This reply was modified 4 months ago by Salesforce | shariq shariq.
    #37129
    Salesforce | Parul Parul #2
    Forcetalks

    This will tell IE9 that you would prefer it operate like IE8, and IE8 still works fine.  However, I believe this meta tag needs to be one of the first things declared in the page, and under some situations (like showHeader=true) you may not have control over that.  In that case, you can add the following to the Apex controller:

    Apexpages.currentPage().getHeaders().put(‘X-UA-Compatible’, ‘IE=8’);
    Remember that Apex controllers can also be served up as extensions to other custom controllers or standard controllers – so if you need to add this to several pages but don’t want to rewrite the constructor of each controller, you can add one extension, place the above in the constructor – and then add the extension to existing pages without having to manipulate a lot of existing Apex.

Viewing 3 posts - 1 through 3 (of 3 total)

Please to reply to this topic.

CONTACT US

We're not around right now. But you can send us an email and we'll get back to you, asap.

Sending

About Us

Forcetalks is a Salesforce collaboration platform for coders & developers, geeks & nerds, consultants & business heads, admins & architects, managers & marketers and of course the business owners. A community where you can learn from, where you can contribute to. For you. For Salesforce. Read More...

Copyright 2019 Forcetalks. All Right Reserved.

Log in with your credentials

or    

Forgot your details?