Kevin Meredith Kevin Meredith - 1 year ago 39
HTML Question

Javascript Not Running in HTML

Given the following:


<!DOCTYPE html>



<tr class='foo'><td>one</td></tr>
<tr class='foo'><td>two</td></tr>
<tr class='foo'><td>three</td></tr>

<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javscript" src=""></script>



// Generated by CoffeeScript 1.10.0
(function() {
var hasChildren, rowsWithChildren;

$(function() {
return console.log('starting');

$(function() {
var filtered, rows;
rows = $('tr');
filtered = rowsWithChildren(rows);
return console.log(filtered);

rowsWithChildren = function(rows) {
return _.filter(rows, function(r) {
return hasChildren(r);

hasChildren = function(row) {
return row.children().length === 1;


When I open that HTML page in my Chrome Browser, I see the table on the screen. But, I don't see any
console.log ...
statements in the output of the Developer Tools

Also, when I look at Dev Tool's
, I don't see the JS from

What's wrong with this HTML?

Answer Source

The third script element has a wrong type value. With a wrong value, the loaded file will not be interpreted as JavaScript.

So change:

<script type="text/javscript"  ...


<script type="text/javascript"  ...