php - Serving up a static image in IE results in Quirks Mode -
following approach mentioned here can serve png, gif, or whatever images want since don't have control on <!doctype>
of page (that know of) ie9 (and presumably others) decide "document mode" "quirks" default.
ie displays image (just slight shadow around edge of document provides clue of problem) maybe should content , disregard dreaded quirks mode status given page created in way.
my approach similar 1 in above answer:
# other processing not output / echoed # <-- can else sent here calm ie down? header('content-type: image/png'); readfile($imagepath);
this approach results in html document looks according ie's developer tools:
<html> <head> <title></title> <body> <img src="theurlofthepage" />
is there way tweak doctype
(or lack thereof) without getting in way of header
sent nor image want output? attempts pass doctype
@ various stages of above process broke ability display image properly.
use header template includes doctype:
<?php echo <<<header <!doctype html> <html> <body> header; ?>
and footer template ends file:
<?php echo <<<footer </body> </html> footer; ?>
in main file, include both existing content:
<?php include('header.php') include('content.php') include('footer.php') ?>
use output buffering cache output string internally , send user in 1 shot. in long-running scripts, want flush output buffer periodically feedback sent http client. can done ob_end_flush(). function turns off output buffering, might want call ob_start() again after flush.
- supercharge css php under hood
- supercharging css, part 3: css variables
- css variables php – css compression – manifest file
- using dynamic css
- creating , rendering css templates (eg. style.css.php)
the link header useful, in firefox:
Comments
Post a Comment