OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Why does Django require javascript to be linked in the head instead of the end of the body?

  • Thread starter Thread starter Adan
  • Start date Start date
A

Adan

Guest
I had to do a few extended templates in django. For simplicity let's call them base.html, blog_base.html, and blog.html. (blog extends blog_base, blog_base extends base). I have a few javascript files in base.html, which worked fine in blog_base.html, but when blog.html was loaded, no GET request was ever sent to retrieve the files.

I found that the only location for the tags that worked were in the section of base.html. This is odd to me because not a single other location I put these (even in blog.html) was able to load the static files. Is this a django problem or a javascript?
<p>I had to do a few extended templates in django. For simplicity let's call them base.html, blog_base.html, and blog.html. (blog extends blog_base, blog_base extends base). I have a few javascript files in base.html, which worked fine in blog_base.html, but when blog.html was loaded, no GET request was ever sent to retrieve the files.</p>
<p>I found that the only location for the tags that worked were in the section of base.html. This is odd to me because not a single other location I put these (even in blog.html) was able to load the static files. Is this a django problem or a javascript?</p>
 

Latest posts

Top