jeudi 3 janvier 2019

This SO post explains how to include JavaScript specific to a page.

However, this method is causing this error in charges.js at line 1: Uncaught SyntaxError: Unexpected token <

In the Chrome console, the doctype declaration is highlighted as having the error.

The simplified view is below. The JavaScript file in question is empty.

Why is this happening?

<% content_for :javascript_includes do %>
  <%= javascript_include_tag "charges.js" %>
<% end %>

<style>
    #pageBox {
        width: 600px;
        margin: 60px auto;
    }

    .header {
        text-align: center
    }

    .content {
        margin-top: 50px;
    }
</style>

</div>

Aucun commentaire:

Enregistrer un commentaire