0

enter image description here

I'm trying out vuejs by following along with the laracasts series of webcasts on this. I'm using netbeans 8.1 as my editor and you can see my file structure above. In https://laracasts.com/series/learning-vuejs/episodes/5 Jeffery Way shows the following code which I have adapted:

<head>
    <title>Tasks</title>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="shortcut icon" href="">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css">
    <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/1.0.12/vue.js"></script>
    <script type="text/javascript" src="Sources/app.js"></script>

</head>

In the console I see:

GET http://localhost:8383/vue1/Sources/app.js net::ERR_EMPTY_RESPONSE

I suspect I have the file path wrong. I've been reading http://www.jibbering.com/faq/faq_notes/script_tags.html but have not not come up with an answer. What am I doing wrong?

1
  • 1
    Assuming the HTML you posted is in the "Site Root" folder, the src should be ../Sources/app.js I would also advise against using spaces in your folder or file names. Commented Jan 5, 2016 at 15:52

1 Answer 1

3

Is "Site Root" a subfolder on the same folder as "Sources"?

If yes, try it out:

<script type="text/javascript" src="../Sources/app.js"></script>

Or move Sources dir to inside Site Root.

Sign up to request clarification or add additional context in comments.

4 Comments

I moved the app.js file to the site root directory and changed the code to <script type="text/javascript" src="app.js"></script> . It now appears to be working - thanks
You can also move it to a subfolder inside "Site Root" directory. So you access it by doing <script type="text/javascript" src="foldername/app.js"></script>.
Thanks Jefff, I'm not knowledgeable about js, so is the "site root" a common feature of html/js projects? I'm not sure what its purpose is?
Not really. Only the files inside it are important. It's just the folder where your site is being saved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.