Forum Moderators: not2easy
// style.css
#tester { display: block }
// header.php
if (isset($css) ||
isset($_GET['id']) ||
substr($_SERVER['SCRIPT_NAME'], -8) === 'post.php')
echo <<<EOF
<link rel="stylesheet" href="https://www.example.com/style.css">
<div id="tester" hidden></div>
EOF;
// JavaScript (I already use jQuery, so it's not being imported just for this
if ((val = $('#richhtml')).length) {
var tester = 'tester=' + $('#tester').css('display');
val.ajax('/example.php?' + tester);
}
// example.php, loaded via Ajax
if ($_GET['tester'] !== 'block')
echo <<<EOF
<link rel="stylesheet" href="https://www.example.com/style.css">
EOF; I wish you wouldn't say "include", since that sounds like, well, include (as opposed to include_once, but I guess that only applies within the same script).