Body: <p>Anyone know what could be wrong? It doesn't load files residing in /craft/templates/js that I include with for example <code>{% includeJsFile "/js/file.min.js" %}</code>, only if the js folder is in the public folder.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-08T00:41:30.590Z
Comments.Text: That should work out of the box – very odd. You might want to turn on [`devMode`](https://craftcms.com/support/dev-mode) and visit the URL to your JS assets directly (e.g. "http://example.com/js/file.min.js") in your browser, just to see what Craft spits out. Also, check your logs in `/craft/storage/runtime/logs` for `[error]` messages. In any case; be advised that keeping JS and/or CSS files in the `/templates` folder is [not best practice](http://craftcms.stackexchange.com/a/15453/1098) – unless you have a very good reason, you should always serve JS & CSS from your public folder.
Comments.UserDisplayName: Mats Mikkel Rummelhoff
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-11-08T23:36:56.077Z
Comments.Text: Will check it out and report back.
Comments.UserDisplayName: Anders
Tags: <templating>
Title: IncludeJsFile doesn't load from within the templates directory
ThreadText: # IncludeJsFile doesn't load from within the templates directory
  
  (Asked by: username_0 on 2016-11-06)
  
  Anyone know what could be wrong? It doesn't load files residing in /craft/templates/js that I include with for example `{% includeJsFile "/js/file.min.js" %}`, only if the js folder is in the public folder.
  
  **Tags:** templating
  
  > **Comments:**
  > **username_1**: That should work out of the box – very odd. You might want to turn on [`devMode`](https://craftcms.com/support/dev-mode) and visit the URL to your JS assets directly (e.g. "http://example.com/js/file.min.js") in your browser, just to see what Craft spits out. Also, check your logs in `/craft/storage/runtime/logs` for `[error]` messages. In any case; be advised that keeping JS and/or CSS files in the `/templates` folder is [not best practice](http://craftcms.stackexchange.com/a/15453/1098) – unless you have a very good reason, you should always serve JS & CSS from your public folder.  
  > **username_0**: Will check it out and report back.  
  
  ---
  
  ## 0 answers
  
  