use IE Compatible modus for old Uniface web application

Author: lammersma@hotmail.com (lammersma)

Hi all,   Once there was an Uniface web application. The customer used it every day. This application was build in 2001, using Uniface Server Pages. Still it is served to 12000 satified users by Uniface 8.4. But within two weeks the humble system administrator wants to  roll out Internet Explorer 10... Unfortunately this old application is not working on this evil version of IE. Happily Microsoft is aware of this and implemented something they called the compatibility modus. Sound like a happy ending story, but..... We tried to force the application to this compatibility modus using a meta tag: <meta http-equiv="X-UA-Compatible" content="IE=8" /> But this does not work. It turns out this meta tag needs to be the first element in the header. But Uniface puts some elements on top of ours. <HTML> <HEAD> <META NAME="Generator" CONTENT="UNIFACE 8.1.01" > <META NAME="Generated" CONTENT="20140805160201"> <META NAME="Changed" CONTENT="20140805160201"> <LINK rel="stylesheet" type="text/css" href="../css/applic.css"> <TITLE>INLOGGEN</TITLE> <meta http-equiv="X-UA-Compatible" content="IE=8" />   It needs to be: <HTML> <HEAD> <meta http-equiv="X-UA-Compatible" content="IE=8" /> <META NAME="Generator" CONTENT="UNIFACE 8.1.01" > <META NAME="Generated" CONTENT="20140805160201"> <META NAME="Changed" CONTENT="20140805160201"> <LINK rel="stylesheet" type="text/css" href="../css/applic.css"> <TITLE>INLOGGEN</TITLE>   Is there anyway to get this element on top of the rest?    Kind regards!   Peter

3 Comments

  1. OK great, hopefully that will get you out of trouble! Remember that by default Uniface will regenerate the hts file when you re-compile the USP. So you'll either need to disable that or move your modified hts out of the way.


    Author: James Rodger (james.r.rodger@gmail.com)
  2. Hi Peter, There are 3 options that I can think of, the best fit for you is going to depend on what your application is like.

    1. Fix the application to work with IE 10. I'm assuming this would involve changing too much?
    2. You could move to external HTS files. This would let you create the HTS skeleton however you like, but you then have to maintain the files separately and not using the HTML hooks in the USP.
    3. At some point after the webgen you could detect what browser is in use and run a $replace to inject the meta tag. Something like $webinfo("OUTPUT") = $replace($webinfo("OUTPUT"), 1, "<HEAD>", "<HEAD><meta ... />", 1)

    James


    Author: James Rodger (james.r.rodger@gmail.com)
  3. Hi James,   Fixing the issues is the best and only real solution to the problems. But we need a quick win! Changing the HTS file is it! Thanks for the help!   Kind regards,   Peter


    Author: lammersma (lammersma@hotmail.com)