In trying to load a style sheet via JavaScript I ran into a problem...the
style sheet doesn't load. This simple task has turned into a vexing problem.
Here is the script and html:
<html>
<head>
<title>load a style sheet</title>
<script type="text/javascript" language="JavaScript">
var mystyle="css/mystyle.css";
document.write=("<link rel='stylesheet' href='" + mystyle + "'
type='text/css'>");
</script>
</head>
<body>
<p class="foobar">display some text in the foobar class</p>
</body>
</html>
This is so simple it almost has to work, but it doesn't. I'm suspecting
either the browser is the problem (IE5.5) or maybe it has something to do
with being a local file or both or none of the above...dunno. Can anybody
see anything wrong here?
TIA!