title: MVC3 Relative URL Paths - Javascript
body: <p>I have an issue with relative paths whereby when the web app is running off subdirectory of the domain, the paths are not correct. e.g. <a href="http://www.example.com/webapp/" rel="nofollow noreferrer">http://www.example.com/webapp/</a></p>
  
  <p>If I use <code>@Url.Content("~/path/to/action")</code> on the page it is fine. I can even embed the <code>@Url.Content("")</code> inside the javascript script. I want to clean up the page I wanted to put the javascript inside a js file and reference that. Now that the <code>@Url.Content</code> is being called inside the javascript file, it doesn't seem to work (probably for obvious reasons). How can I get around this issue?</p>
  
  <p>I had a look at the <code>&lt;base /&gt;</code> but that doesn't seem to work.</p>