Why do link paths in JavaScript not require a precedding / but paths in PHP includes do?
<p>Sounds nit picky but this had me hung up for about an hour or so.</p>

<p>I have a path set like this in JavaScript</p>

<pre><code>const JAVASCRIPT =              'host/source/ArcJB.js';
</code></pre>

<p>which renders in my document like this:</p>

<pre><code>&lt;script type="text/javascript" src="host/source/ArcJ.js"&gt;&lt;/script&gt;
</code></pre>

<p>If I put in a preceding <code>/</code> it breaks the link.</p>

<p>In PHP, for server-side paths I use:</p>

<pre><code>&lt;?php
    include_once getcwd() . "/host/source/class.ControlEntry.php";
</code></pre>

<p>If I don't put in the <code>/</code> it breaks things.</p>

<p>I guess conceptually how am I suppose to know this so I don't have to pull my hair out with trial and error?</p>

<p>Also noted:</p>

<p>Paths inside my .js file work with either a <code>/</code> or not a <code>/</code> preceding the path.</p>

<p>These are used for image lookup or ajax calls.</p>
