JS File Is Loaded In HTML (generated Via Markdown) But Not Executing

- 1 answer

The HTML file is generated using Markdown. I have included a JavaScript file in HTML. It is visible that it is loaded in the browser (tried on Mozilla firefox).

See the proof below.

I tested if JS is enabled or not from

enter image description here

But somehow, it is not being executed.

Below is my generated HTML

<!DOCTYPE html>
<html lang="en">
        <meta charset="UTF-16"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>
<meta name="generator" content="Bootply-JBake-Custom"/>
<meta http-equiv="content-type" content="text/html; charset=UTF-16"/>

    <link target="_blank" rel="nofollow noreferrer" href="/css/bootstrap.min.css" rel="stylesheet">
    <link target="_blank" rel="nofollow noreferrer" href="/css/asciidoctor.css" rel="stylesheet">
    <link target="_blank" rel="nofollow noreferrer" href="/css/base.css" rel="stylesheet">
    <link target="_blank" rel="nofollow noreferrer" href="/css/prettify.css" rel="stylesheet">
    <link target="_blank" rel="nofollow noreferrer" href="/css/styles.css" rel="stylesheet">
    <link target="_blank" rel="nofollow noreferrer" href="/css/animate.css" rel="stylesheet">
<link rel="shortcut icon" target="_blank" rel="nofollow noreferrer" href="favicon.ico">
<script src="/js/jquery-1.11.1.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/prettify.js"></script>
  <body onload="prettyPrint()">
    <div id="wrap">

<div class="navbar navbar-default navbar-fixed-top">
      <div class="container">
        <div class="navbar-header">
          <a target="_blank" rel="nofollow noreferrer" href="/index.html" class="navbar-brand">LOGO</a>
          <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#navbar-main">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        <div class="navbar-collapse collapse" id="navbar-main">
          <ul class="nav navbar-nav">
                          <li><a target="_blank" rel="nofollow noreferrer" href="/projects/projects.html">Projects</a></li>
              <li><a target="_blank" rel="nofollow noreferrer" href="/about.html">About</a></li>
              <li><a target="_blank" rel="nofollow noreferrer" href="/categories.html">Categories</a></li>
    <div class="container">
        <div class="page-header" id="banner">
            <div class="row">
                <div class="col-lg-8 col-md-7 col-sm-6">
         <!-- This script is loading but not executing -->
         <script type="text /javascript" src="projects.js"></script>
<p>Here is the list of projects</p>

        <div id="push"></div>
    <div id="footer">
      <div class="container">







<script type="text /javascript" src="projects.js"></script>

Remove the space in type="text /javascript with the result:

<script type="text/javascript" src="projects.js"></script>

This should allow the browser to parse the HTML correctly and load the script.

EDIT: Or remove the type attribute from the <script> tag entirely, as suggested by the comment below.