 <p>You can try <a href="https://developer.mozilla.org/en/HTML/Element/base" rel="nofollow">using the <code>&lt;base&gt;</code> tag</a>. This will set your Base URL to whatever you need:</p> <pre><code>&lt;base href="http://yourdomain.com/"&gt; &lt;script src="js/remotescript.js"&gt;&lt;/script&gt; </code></pre> <p>Note this means now your <em>local</em> scripts need to be in absolute form:</p> <pre><code>&lt;script src="http://localhost/js/phonegap.js"&gt;&lt;/script&gt; </code></pre> <p>See <a href="http://stackoverflow.com/q/6111684/207894">this other question for more info</a> regarding this note. The guy there suggests to prepend a <em>dot</em> (<code>.</code>) before the <em>local relative URL</em>, though I <strong>didn't test this</strong>:</p> <pre><code>&lt;script src="./js/phonegap.js"&gt;&lt;/script&gt; </code></pre>