I have an ASP.NET MVC app that will be hosted within an existing URL structure. For that reason, I want to make my URLs relative. In an ASP.NET MVC, I would do something like the following:
<img src="~/images/logo.png" />
From my understanding, the tilde is an ASP.NET MVC thing that gets rendered at runtime. However, I have some JavaScript files that are static. I need them to reference something relatively.
How could I do ~/images/logo.png in JavaScript?