When Stephan Jennewein was asked to make a client's site work with FireFox, he didn't think it'd be a big deal. The site was fairly small (15-20 pages), had no dynamic content, and used only a bit of DHTML in the site navigation. Just a few CSS tweaks and some JavaScript hacking, and viola!, FireFox compatability. At least, that was the theory.

Despite having static content, the site used a doubly-dynamic method of presenting the data. Every page on the site (well, except for a few), looked exactly like this (well, for the most part), only named differently:

<html>
  <head>
    <link href="dynsitebase/styles.php" rel="stylesheet" type="text/css" />
    <script src="dynsitebase/base.php" language="JavaScript"></script>
    <script src="dynsitebase/themes.php" language="JavaScript"></script>
    <script src="dynsitebase/sitedata.php" language="JavaScript"></script>
    <script src="dynsitebase/pagelayout.php" language="JavaScript"></script>
    <script language="JavaScript">
      document.write("<title>" + CurrentPage.Title + "</title>");
    </script>
   </head>
   <body>
    <script language="JavaScript">
      DataInterface.initialize();
      DataInterface.bindToPage(CurrentPage);
      ImageLoader.preload(CurrentPage);
      LinkLoader.bindToContext(CurrentPage);

      PagePrinter.printHeader(CurrentPage);
      PagePrinter.printNavigation(CurrentPage);
      PagePrinter.printTitle(CurrentPage);
      PagePrinter.printSubTitle(CurrentPage);
      PagePrinter.printMainContent(CurrentPage);
      PagePrinter.printFooter(CurrentPage);

      DataInterface.close();
      ImageLoader.close();
      LinkLoader.close();
      PagePrinter.close();
    </script>
   </body>
</html>

As you may have guessed, the various JavaScript functions call a mess of other JavaScript functions in order to dynamically display the static content. The JavaScript, in turn, is dyanmically generated by mess of PHP pages, many relying on the name of the page passed as the HTTP_REFERER header ...

function dynsitebase_PagePrinter_render()
{
  echo "var PagePrinter = new Object()";

  echo "PagePrinter.printHeader = function(pageObj)";
  echo "{";
  echo "  document.write(\"<div class='$css_headerdivclass'>\");";
  echo "  document.write(\"<h1 class='$css_h1headerdivclass'>>");";
  echo "  if (pageObj.header) ";
  echo "  {";
  echo "    document.write(pageObj.header);";
  echo "  }";
  echo "  else";
  echo "  {";
  echo "    document.write(\"$headerToRender\");";
  echo "  }";

  /* snipped few hundred lines */

}

After explaining all that would need to be changed to work with FireFox, the client just descided to just mail those users a brochure.

[Advertisement] BuildMaster allows you to create a self-service release management platform that allows different teams to manage their applications. Explore how!