0

I have a simple page that does a console.log:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html>
<head>
<title>Chess</title>
<meta charset="utf-8"/>
<script src="js/jquery/external/jquery/jquery.js">
<script>
    for (var i = 0; i < 9; i++) {
        console.log(i);
    }
</script>
</head>
<body>
<canvas id="maincanvas" width="500" height="500" style="border: 1px solid black;">
</canvas>
</body>
</html>

All I have to do is remove the jquery include and the console.log shows up in the chrome web developer tools console. I'm confused, what is jquery doing to console.log?

Calicoder
  • 1,322
  • 1
  • 19
  • 37

2 Answers2

2

Script tags are not self-closing tags. Please refer to the MDN: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/script

You need to change the script tag to close:

<script src="js/jquery/external/jquery/jquery.js"></script>

Redmega
  • 673
  • 5
  • 21
1

Your

<script src="js/jquery/external/jquery/jquery.js">

is missing a closing </script> tag.