views:

41

answers:

2
<?php
     echo "<script type = 'text/javascript'></script>";
?>

output's page source shows this :

<script type = 'text/javascript'></script></script>

Why is it putting an extra closing tag ?? and who is putting it there ?? browser ? server ? who ?

A: 

Perhaps it's your browser's DOM parser that is putting the ending tag in. Have you checked the code above it to see if you have any unterminated <script> tags?

amphetamachine
I dont have any unterminated script tags, whatever i've shown above is the full code.. But wait.. it is chrome messing up somehow.. Tested with firefox and ie, both dont show extra tag.. only chrome is showing..
Shrinath
+1  A: 

I don't think it is a PHP error. Did you verify that there is no closing script tag after the php block?

<?php
 echo "<script type = 'text/javascript'></script>";
?>
</script>
Joyce Babu