'Blank page when adding javascript to django template

I've created a base template page for my app, which is working quite well, but when I try to add javascript references (jQuery for instance) I got a blank page, but the javascript is loaded in the head but the page body is blank. Even if the referenced javascript source is a empty file. This is no issue with the static file folders, because styles and images were loaded correctly and the first referenced javascript source appears in the page source code provided from the django development server.

here is my template:

{% load staticfiles %}

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="{% static 'backend/css/style.css' %}" />
    <script type="text/javascript" src="{% static 'backend/script/script.js' %}"> 

and the resulting code in my browser

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<link href="/static/backend/css/style.css" rel="stylesheet">
<script src="/static/backend/script/script.js" type="text/javascript">
   $(document).ready(function() {
   function runEffect() { 
   .   .   .
</script>
</head>
<body> </body>

If I remove all javascript references from the head everything works as it is supposed to do. How can I include javascript properly to my django apps?



Solution 1:[1]

Try with this:

{% load static %}
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        {% load staticfiles %}
        <link rel="stylesheet" href="{% static 'backend/css/style.css' %}" />
        <script type="text/javascript" src="{% static 'backend/script/script.js' %}"></script>
    </head>
    <body>
               {{ your_content}}
    <script>Your custom script</script>
    </body>
</html>

Solution 2:[2]

Change browser for me that works in my case

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Christopher