Forum Moderators: open
I am having trouble validating this javascript code to XHTML strict.
<script type="text/javascript">if ((screen.width==1024)&(screen.height==768)){document.write ("<link rel='stylesheet' type='text/css' href='<?= $path?>/inc/css/1024x768.css' />");}if ((screen.width==1280)&(screen.height==1024)){document.write ("<link rel='stylesheet' type='text/css' href='<?= $path?>/inc/css/1280x1024.css' />'");}</script>
<?=path?> is the webpage path.
Any ideas please?
Thank you
<script type="text/javascript">
// <[CDATA[
if ((screen.width==1024)&(screen.height==768)){document.write ("<link rel='stylesheet' type='text/css' href='<?= $path?>/inc/css/1024x768.css' />");}if ((screen.width==1280)&(screen.height==1024)){document.write ("<link rel='stylesheet' type='text/css' href='<?= $path?>/inc/css/1280x1024.css' />'");}
// ]]>
</script>
Thank you
[edited by: jatar_k at 2:22 am (utc) on Oct. 7, 2005]
[edit reason] no urls thanks [/edit]
<script type="text/javascript" scr="screenmodes_js.php"></script> screenmodes_js.php would be
<?php header("Content-Type: text/javascript");
$path = "/path/to";
if ((screen.width==1024)&(screen.height==768)){document.write ("<link rel='stylesheet' type='text/css' href='<?= $path?>/inc/css/1024x768.css' />");}if ((screen.width==1280)&(screen.height==1024)){document.write ("<link rel='stylesheet' type='text/css' href='<?= $path?>/inc/css/1280x1024.css' />'");}