<script> tag in php file confuses inspection
I have a very simple .php file that just runs phpinfo(). The php bit is nested inside an XHTML structure though (see below). When I run the file, it works fine.
However, I'm also using a <script> tag and for some reason it confuses the code inspector, which is picking up all sorts of spurious errors. If I remove the <script> line, the code inspector is happy again.
Any ideas why?
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="content-type" content="application/xhtml+xml;charset=utf-8" />
<title>PHP Info</title>
<script src="./style/functions.js" /></script>
</head>
<body>
<?php phpinfo(); ?>
</body>
</html>
Please sign in to leave a comment.
Hi there,
I have no clue at all of what do you see there on your screen. Therefore: please, spare few seconds of your precious time and share a screenshot for that code (using vanilla Default or Darcula color scheme).
Thank you.
You have an error in your code: you have closed script tag twice: first time by using /> and second time by using </script>.
If you remove "/" from "/>" (or whole "</script>") it will work OK.
Aha! Thank you!