Automatisk valg af CSS
Hej,Nogen som kan fortælle hvorfor mit script giver blank side?
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<SCRIPT LANGUAGE="JavaScript">
<!-- Begin
function redirectCSS() {
if ((screen.width == 640) && (screen.height == 480))
{document.write("<link href='css/test.css' rel='stylesheet' type='text/css'>")}
else if ((screen.width == 800) && (screen.height == 600))
{document.write("<link href='css/test.css' rel='stylesheet' type='text/css'>")}
else if ((screen.width == 1024) && (screen.height == 768))
{ document.write("<link href='css/test.css' rel='stylesheet' type='text/css'>")}
else
{document.write("<link href='css/test.css' rel='stylesheet' type='text/css'>")}
}
// End -->
</script>
</head>
<body onLoad="redirectCSS()">
<h1>This is a Heading</h1>
<p>This is a paragraph.</p>
</body>
</div>
</html>