-1

I'm on a LAMP stack - here is my file structure.

html
  main.php
javascript
  main.js
style
  main.css

From main php I attempt to include the JS using:

<script src="../javascript/main.js"></script>

It doesn't work (404) but this does..

<link rel = "stylesheet" type = "text/css" href = "../style/main.css" />

What could be wrong?

halfer
  • 19,824
  • 17
  • 99
  • 186
Craig
  • 1,648
  • 1
  • 20
  • 45
  • 1
    What is "doesnt work"? Include error and more details pls. http://stackoverflow.com/help/how-to-ask – Daniel Brose Mar 24 '17 at 02:18
  • Do you get any errors in the browser's console? "Doesn't work" could mean "the file wasn't found with that path", or "the file was downloaded but had JS errors", or "the file was downloaded and was valid but you forgot to call any functions or need to add a document ready handler", etc.... – nnnnnn Mar 24 '17 at 02:20

1 Answers1

0

I feel very stupid. Lots of time spent and suddenly here is the answer...

Go to /etc/apache2/conf-available/javascript-common.conf. You will find this:

Alias /javascript /usr/share/javascript/

Craig
  • 1,648
  • 1
  • 20
  • 45