JS与CSS写在同一份文件

查看文章:把JS与CSS写在同一个文件里,还是可以用滴

传说中的测试

传说中的测试者一号。如果你看到我有边框跟颜色,那就是说CSS生效了。

传说中的测试者二号。如果你看到我,那JS就没生效了。

使用同一份文件:jscss.php

<link type="text/css" rel="stylesheet" href="jscss.php" />
<script type="text/javascript" src="jscss.php"></script>

jscss.php的内容

<?header('Content-type: */*');?>
<!-- /*
window.onload=function(){
	document.getElementById("test2").innerHTML="传说中滴JS测试者。如果你看到我,那<strong>JS</strong>也生效了";
}
<!-- */ 
<!-- #test1,#test2{border:3px #000 solid;padding:5px;color:#123456;background-color:#ccc;} strong{color:red;}

Copyright © 2006-2007 aoao , Some Rights Reserved .