index.htm
<html>
<script language=javascript src=test.php>
</script>
</html>test.php
<?
print "document.write('ok')"
?>我自己弄错了,真是的,不用header函数
print "document.write('ok');";
这样的