title: Parent Directory File Path in Javascript not working in Linux
body: <p>I built a website and have been testing it on a Mac with no problems for several weeks. I am now working in ubuntu. I copied my webiste with all the folders and files to the desktop of my Linux machine. It stopped working. I narrowed it down to a file path problem.  </p>
  
  <p>I'll give a simplified version of the problem with one html file and two js files (plus jquery). </p>
  
  <p>In the index.html file I have: </p>
  
  <pre><code>    &lt;script src="jquery.js"&gt;&lt;/script&gt;
      &lt;script src="first.js"&gt;&lt;/script&gt; 
  </code></pre>
  
  <p>In first.js I have:</p>
  
  <pre><code>$("body").append("&lt;script src=second.js&gt;&lt;/script&gt;");
  </code></pre>
  
  <p>In second.js I have: </p>
  
  <pre><code>$("body").append("hello");
  </code></pre>
  
  <p>This works fine when I keep all the files in the same directory/folder.  </p>
  
  <p>It also works if I put second.js inside a directory "child" and change first.js like this:  </p>
  
  <pre><code>$("body").append("&lt;script src=child/second.js&gt;&lt;/script&gt;");
  </code></pre>
  
  <p>However, if I put second.js in the parent directory and change first.js to:  </p>
  
  <pre><code>$("body").append("&lt;script src=../second.js&gt;&lt;/script&gt;");
  </code></pre>
  
  <p>all of a sudden it stops working.  </p>
  
  <p>I read up on linux file path systems, but mostly I get explanations of how the command line works and it doesn't help me. I don't understand how to fix the problem and more importantly I am concerned that even if I change the file path to work on my Linux desktop it will then stop working once I upload it back on an actual server. I am really enjoying working inside the Linux environment and would like to continue testing my website in it, but I don't know what is going on with this issue.</p>